Complete the code to import the migrations module in NestJS.
import { [1] } from '@nestjs/typeorm';
The TypeOrmModule is imported to use migrations with NestJS and TypeORM.
Complete the code to configure migrations in the TypeOrmModule.
TypeOrmModule.forRoot({
migrations: ["[1]"],
migrationsRun: true,
});The migrations array expects the path to compiled JavaScript migration files, usually migrations/*.js.
Fix the error in the migration class name to follow NestJS migration conventions.
export class [1] implements MigrationInterface { async up(queryRunner: QueryRunner): Promise<void> { // migration code } async down(queryRunner: QueryRunner): Promise<void> { // revert code } }
Migration class names should be PascalCase starting with a capital letter, like CreateUserTable.
Fill both blanks to correctly run migrations using the CLI command.
npm run [1] -- [2]
The command npm run typeorm -- migration:run runs the migrations using the TypeORM CLI.
Fill all three blanks to create a migration file with the correct CLI command and naming.
npm run [1] -- [2] [3]
The command npm run typeorm -- migration:create AddProductsTable creates a new migration file named AddProductsTable.