821 B
821 B
TypeORM Migrations Guide
This project uses TypeORM migrations for database schema management in production environments.
Migration Commands
Generate Migration
Generate a migration file based on entity changes:
# Start the database first
yarn docker:dev:detached
# Generate migration from entity changes
yarn migration:generate src/migrations/YourMigrationName
Create Empty Migration
Create an empty migration file for custom SQL:
yarn migration:create src/migrations/YourMigrationName
Run Migrations
Apply pending migrations to the database:
yarn migration:run
Revert Migration
Revert the last applied migration:
yarn migration:revert
Show Migration Status
Show which migrations have been applied:
yarn migration:show