ci: Add proper SQL migration runner with tracking

- Creates run-migrations.ts that reads migrations/*.sql files
- Tracks applied migrations in schema_migrations table by filename
- Handles existing version-based schema by adding filename column
- CI now runs migrations before deploy

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Kelly
2025-12-09 11:12:50 -07:00
parent 5119d5ccf9
commit a9b7a4d7a9
2 changed files with 201 additions and 1 deletions

View File

@@ -148,7 +148,7 @@ steps:
commands:
- cd backend
- npm ci --prefer-offline
- npx tsx src/db/migrate.ts
- npx tsx src/db/run-migrations.ts
depends_on:
- docker-backend
when: