Skip to content

Replace TypeORM synchronize: true with a Versioned Migration Workflow Using the TypeORM CLI #229

@mftee

Description

@mftee

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions