ci: add migration integrity gate for migration-relevant changes

This commit is contained in:
Abhimanyu Saharan
2026-02-12 20:04:38 +00:00
parent 5695c0003d
commit e60734f3e7
3 changed files with 73 additions and 1 deletions

View File

@@ -1,3 +1,23 @@
# Development workflow
Placeholder: see root `README.md` for current setup steps.
## Migration integrity gate (CI)
CI enforces a migration integrity gate to prevent merge-time schema breakages.
### What it validates
- Alembic migrations can apply from a clean Postgres database (`upgrade head`)
- Alembic revision graph resolves to a head revision after migration apply
- On migration-relevant PRs, CI also checks that model changes are accompanied by migration updates
If any of these checks fails, CI fails and the PR is blocked.
### Local reproduction
From repo root:
```bash
make backend-migration-check
```
This command starts a temporary Postgres container, runs migration checks, and cleans up the container.