A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
$ yarn install
# development
$ yarn run start
# development with watch mode
$ yarn run start:dev
# production mode
$ yarn run start:prod
Create a migration
$ npm run migrate:create <path>
$ yarn migrate:create <path>
# example
$ npm run migrate:create src/migrations/migration_name
$ yarn migrate:create src/migrations/migration_name
Generate a migration
$ npm run migrate:g <path>
$ yarn migrate:g <path>
# example
$ npm run migrate:g src/migrations/migration_name
$ yarn migrate:g src/migrations/migration_name
Run a migration
$ npm run migrate:run
$ yarn migrate:run
Revert a migration
$ npm run migrate:rollback
$ yarn migrate:rollback
Migrations scripts with yarn
"typeorm": "ts-node ./node_modules/typeorm/cli",
"migrate:create": "yarn typeorm migration:create",
"migrate:g": "yarn typeorm -d ./src/config/data.source.ts migration:generate",
"migrate:run": "yarn typeorm migration:run -d ./src/config/data.source.ts",
"migrate:rollback": "yarn typeorm -d ./src/config/data.source.ts migration:revert"
Migrations scripts with npm
"typeorm": "ts-node ./node_modules/typeorm/cli",
"migrate:create": "npm run typeorm -- migration:create",
"migrate:g": "npm run typeorm -- -d ./src/config/data.source.ts migration:generate",
"migrate:run": "npm run typeorm migration:run -- -d ./src/config/data.source.ts",
"migrate:rollback": "npm run typeorm -- -d ./src/config/data.source.ts migration:revert"
- To install ts-node globally
$ npm install -g ts-node
- Copy migrations scripts into the package.json