Description:
Replace TypeORM synchronize: true (development-only) with an independent, proper migration workflow so schema changes are tracked and reproducible.
Tasks:
- Set
synchronize: false in the TypeORM config
- Create
src/database/data-source.ts exporting a standalone DataSource for the TypeORM CLI
- Add npm scripts:
migration:generate, migration:run, migration:revert
- Generate an initial migration from the existing entities
- Update the setup section of
README.md to include migration commands
Acceptance Criteria:
- Running
npm run migration:run applies all pending migrations to a fresh database
- Running
npm run migration:revert rolls back the last migration
synchronize: true is no longer used in any environment