Problem Statement
No migration consistency check exists in CI. Entity changes may be deployed without corresponding migrations, causing schema drift between code and database.
Evidence
infrastructure/ci/quality-gates.yml — No migration check
- Entity files:
gist.entity.ts — defines columns
- Migration files:
CreateGistsTable.ts — defines columns
Impact
Entity changes may be deployed without corresponding migrations. Schema drift leads to runtime errors.
Proposed Solution
- Add CI step that runs
npm run migration:generate in dry-run mode
- Compare generated migration with existing migrations
- Fail CI if there are pending changes
- Report the pending changes in CI output
Technical Requirements
- Must run against a test database (use PostgreSQL service container)
- Must not auto-generate migration files (dry-run only)
Acceptance Criteria
- CI step detects entity-migration drift
- CI fails if entity changes exist without corresponding migration
- CI reports which changes are pending
- No pending changes means all checks pass
File Inventory
infrastructure/ci/quality-gates.yml
Dependencies
Issue #32 (EnablePostGIS migration) must be created first.
Testing Strategy
- Add a test entity change, verify CI detects it
Security Considerations
Prevents schema-related security issues (e.g., missing column constraints).
Definition of Done
Problem Statement
No migration consistency check exists in CI. Entity changes may be deployed without corresponding migrations, causing schema drift between code and database.
Evidence
infrastructure/ci/quality-gates.yml— No migration checkgist.entity.ts— defines columnsCreateGistsTable.ts— defines columnsImpact
Entity changes may be deployed without corresponding migrations. Schema drift leads to runtime errors.
Proposed Solution
npm run migration:generatein dry-run modeTechnical Requirements
Acceptance Criteria
File Inventory
infrastructure/ci/quality-gates.ymlDependencies
Issue #32 (EnablePostGIS migration) must be created first.
Testing Strategy
Security Considerations
Prevents schema-related security issues (e.g., missing column constraints).
Definition of Done