-- Seeds the roles table (idempotent, already in 001) and creates one
-- ADMIN user so you can log in immediately after deployment.
-- Generate the hash first:  php -r "echo password_hash('changeme123', PASSWORD_DEFAULT), PHP_EOL;"
-- then paste it below in place of the placeholder before running this file.
USE gold_jewellery;

INSERT INTO users (role_id, name, email, password_hash, is_active)
SELECT r.id, 'Administrator', 'admin@example.com',
       '$2y$10$REPLACE_WITH_OUTPUT_OF_password_hash_ABOVE',
       1
FROM roles r WHERE r.name = 'ADMIN'
ON DUPLICATE KEY UPDATE name = VALUES(name);
