Objective
Replace hand-rolled DDL with a real migration framework so schema changes are versioned, ordered, and reversible.
Current state
- Migrations are
CREATE TABLE IF NOT EXISTS / ALTER TABLE statements embedded in api/models/finding.py (run_migrations), executed on every boot by startup.sh and create_app()
- No migration history table, no ordering guarantees, no rollback, no way to review a schema diff in a PR
Scope
Out of scope
Acceptance criteria
Category
Infrastructure / Database
Objective
Replace hand-rolled DDL with a real migration framework so schema changes are versioned, ordered, and reversible.
Current state
CREATE TABLE IF NOT EXISTS/ALTER TABLEstatements embedded inapi/models/finding.py(run_migrations), executed on every boot bystartup.shandcreate_app()Scope
DatabaseManager; it keeps only queriesalembic upgrade headruns as the release/startup step (startup.sh and compose)Out of scope
Acceptance criteria
run_migrationsad-hoc DDL removedCategory
Infrastructure / Database