Bird
0
0

Which file typically contains the migration logic in a NestJS project using TypeORM?

easy📝 Conceptual Q2 of 15
NestJS - Database with TypeORM
Which file typically contains the migration logic in a NestJS project using TypeORM?
AA service file with business logic
BA controller file handling HTTP requests
CA class file implementing MigrationInterface
DA module file defining imports
Step-by-Step Solution
Solution:
  1. Step 1: Identify migration file type

    Migrations are classes that implement MigrationInterface to define schema changes.
  2. Step 2: Differentiate from other files

    Services, controllers, and modules serve different purposes unrelated to migrations.
  3. Final Answer:

    A class file implementing MigrationInterface -> Option C
  4. Quick Check:

    Migration logic location = MigrationInterface class [OK]
Quick Trick: Migrations are classes, not controllers or services [OK]
Common Mistakes:
  • Confusing migration files with controllers
  • Thinking services contain migration logic
  • Assuming modules define migrations

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes