Compare commits

...

4 Commits

Author SHA1 Message Date
2716e60d2d Merge pull request 'fix: include all SQL files in dbinit configmap' (#7) from fix/include-all-sql-in-dbinit into main 2026-04-28 09:04:17 +00:00
0c569ec528 fix: include all SQL files in dbinit configmap (not just 004_*.sql)
The glob was "sql/004_*.sql" which excluded 000_create_db.sql that
creates hades_user. Changed to "sql/*.sql" to include all migration
files in alphabetical order.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-28 14:34:06 +05:30
6e8b755f38 Merge pull request 'fix: create hades_user in dbinit for shared MySQL' (#6) from fix/create-hades-user-in-dbinit into main 2026-04-28 09:00:37 +00:00
e880f4e9c4 fix: create hades_user in dbinit for shared MySQL compatibility
Shared MySQL (mysql-5-7) only has mysql_user. The hades app connects
as hades_user which doesn't exist. dbinit runs as root, so it can
create the user before migrations run.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-28 14:30:15 +05:30
2 changed files with 6 additions and 1 deletions

View File

@ -2,3 +2,8 @@
-- This file runs first to ensure proper migration ordering
SELECT 'Database migration starting for hades_db' AS message;
-- Create hades_user for app connections (shared MySQL only has mysql_user)
CREATE USER IF NOT EXISTS 'hades_user'@'%' IDENTIFIED BY 'local-hades-pass';
GRANT ALL PRIVILEGES ON hades_db.* TO 'hades_user'@'%';
FLUSH PRIVILEGES;

View File

@ -9,7 +9,7 @@ metadata:
annotations:
argocd.argoproj.io/sync-options: ServerSideApply=true
binaryData:
{{- range $path, $_ := .Files.Glob "sql/004_*.sql" }}
{{- range $path, $_ := .Files.Glob "sql/*.sql" }}
{{ base $path }}: {{ $.Files.Get $path | b64enc }}
{{- end }}
{{- end }}