Files
finetuning-plattform-setup-…/db/03-default-users.sql
m17hr1l b0ed337862 Fix user_to_acl column names in 03-default-users.sql
The user_to_acl table is one of the few join tables that does NOT follow
the tablename_fieldname column naming convention — its columns are the
plain `user_id` and `acl_id`. The previous version used `user_to_acl_user_id`
and `user_to_acl_acl_id` which fail with "Unknown column".

Found by actually running bootstrap-db.sh end-to-end against a fresh DB
(was missing this verification step on the initial commit).

Verified now:
  - schema loads cleanly (36 tables)
  - seed loads (3 ACL roles, 8 email templates)
  - default users insert + ACL mapping works
  - password_verify against argon2id hashes confirms admin123 and test123
2026-05-14 13:05:19 +02:00

29 lines
1.3 KiB
SQL

-- Default users for a fresh local install.
-- Run AFTER 01-schema.sql and 02-seed.sql.
--
-- Credentials:
-- admin@finetune.ai / admin123 (id=1, role=superuser via user_to_acl)
-- testuser@example.com / test123 (id=2, role=user)
--
-- Hashes below are argon2id (PHP password_hash, PASSWORD_ARGON2ID).
-- Regenerate with: docker compose exec fpm php -r "echo password_hash('YOUR_PASS', PASSWORD_ARGON2ID);"
-- IMPORTANT: change these passwords on any deployment that's not strictly local dev.
INSERT INTO `user`
(`user_id`, `user_login`, `user_email`, `user_name`, `user_password_hash`, `user_account_active`)
VALUES
(1, 'admin@finetune.ai', 'admin@finetune.ai', 'Admin',
'$argon2id$v=19$m=65536,t=4,p=1$eXRQVHBNaFFLTmZYZC9pSQ$0iMhgsJVOo1D4U8XNrcDFdkIUCJEf2yY1Tmf8G9zKM0',
1),
(2, 'testuser@example.com', 'testuser@example.com', 'Test User',
'$argon2id$v=19$m=65536,t=4,p=1$YmxWaHpqaHRsU1dmZHFUOA$k8veR56hGcoTsciZGVYv/NuPJSyQ3wgzSTyryW/ynto',
1);
-- Grant admin user superuser ACL (acl_id=1 from the acl seed data).
-- NOTE: user_to_acl is one of the join tables in the schema that does NOT
-- follow the tablename_fieldname column convention — its columns are the
-- plain `user_id` and `acl_id`.
INSERT INTO `user_to_acl` (`user_id`, `acl_id`) VALUES
(1, 1), -- admin → superuser
(2, 3); -- testuser → user