ADR-027: TypeORM Migrations Only
Status: Accepted Date: 2026-06-03 Authors: paulhumanity
Contextโ
Schema changes were split between TypeORM migrations in api/migrations/ and raw SQL files in api/src/database/migrations/. TypeORM only loads compiled migrations from dist/migrations/*.js, so raw SQL in the source tree can be missed on fresh databases.
Decisionโ
All schema changes go through TypeORM migrations in api/migrations/. Raw SQL migration files under api/src/database/migrations/ are forbidden, and CI fails if files are added there.
API deployments opt into running pending migrations on boot with RUN_MIGRATIONS_ON_BOOT=true. The hook runs before Nest starts controllers; local development remains off by default.