This is a simple example of how to use NestJS with TypeORM and automatic migrations.
- Clone the repository
- Run
npm install - Run
docker-compose up -dto start the database - Run
npm run start:devto start the server - The migrations will be automatically run when the server starts
- Change any entity (create a new one, or modify an existing one)
- Run
npm run migration:generate --name=my-migration-nameto generate a new migration - Run
npm run migration:runto run the new migration (or just restart the server)
I've written a tutorial on how to create this project from scratch. You can find it here.