fix: run DB migrations automatically at backend startup

Instead of relying on a manual `pnpm db:migrate` step (which was
connecting to a different postgres than the Docker container), the
backend now calls drizzle migrate() before the server starts. This
ensures migrations always run against the correct database on startup.

Also fixes the Dockerfile to copy migrations into dist/migrations so
the path resolves correctly in the compiled output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 11:00:36 +01:00
parent 4d81266cb1
commit dc1850126b
3 changed files with 15 additions and 1 deletions

View File

@@ -22,6 +22,13 @@
"when": 1741337600000,
"tag": "0002_remove_archived_recording_status",
"breakpoints": true
},
{
"idx": 3,
"version": "7",
"when": 1741420000000,
"tag": "0003_model_photo",
"breakpoints": true
}
]
}