Replace Postgres with MariaDB 11 in docker-compose; convert all database/error_reporting and db/migrations SQL to InnoDB-friendly syntax (DATETIME(6), AUTO_INCREMENT, ON DUPLICATE KEY). Run admin portal DDL in the same migrate one-shot as error_reporting. Switch ingest-api, collector-worker, and api from pg to mysql2 (pools, parameterized queries, transactions). Align ingest writes with er_incident_occurrences and include project_id on idempotency inserts. Add scripts/run-mysql-migrations.sh for host-side applies; update LXC run-migrate/verify, deployment docs, and .env.example (mysql://, ER_MYSQL_*). Verified: npm run build + npm test in ingest-api and collector-worker; npm run build in api. Full docker compose not run here (no local daemon). Co-Authored-By: Paperclip <[email protected]>
8 lines
366 B
SQL
8 lines
366 B
SQL
-- Migration 004: seed initial superadmin (dev/test only)
|
|
-- Default dev credentials: [email protected] / changeme
|
|
|
|
INSERT INTO admin_users (email, password_hash, role)
|
|
SELECT '[email protected]', '$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewYpfQN4ZSIMM.Ey', 'superadmin'
|
|
FROM DUAL
|
|
WHERE NOT EXISTS (SELECT 1 FROM admin_users WHERE role = 'superadmin' LIMIT 1);
|