Recall & Review
beginner
What is a migration in the context of NestJS and databases?
A migration is a script that changes the database schema in a controlled way. It helps keep track of changes like creating or modifying tables, so the database structure matches the app's needs.
Click to reveal answer
beginner
Why should you use migrations instead of manually changing the database?
Migrations keep changes organized and repeatable. They let you update databases safely across different environments and help avoid mistakes or data loss.Click to reveal answer
beginner
Which NestJS package is commonly used to handle migrations?
TypeORM is often used with NestJS for migrations. It provides commands to create, run, and revert migrations easily.
Click to reveal answer
intermediate
What command do you use to generate a new migration file with TypeORM CLI?
You use the command:
typeorm migration:create -n MigrationName to create a new migration file with a given name.Click to reveal answer
beginner
How do migrations help when working in a team?
Migrations let everyone apply the same database changes in the same order. This keeps the database consistent for all developers and avoids conflicts.Click to reveal answer
What is the main purpose of a migration in NestJS projects?
✗ Incorrect
Migrations are used to update the database schema safely and keep track of changes.
Which tool is commonly used with NestJS for database migrations?
✗ Incorrect
TypeORM is a popular ORM that supports migrations and integrates well with NestJS.
What does the command
typeorm migration:run do?✗ Incorrect
This command applies all migrations that have not yet been run to update the database schema.
Why is it important to commit migration files to version control?
✗ Incorrect
Committing migration files ensures everyone uses the same database structure changes.
If you want to undo the last migration, which command would you use?
✗ Incorrect
The revert command undoes the last applied migration to rollback database changes.
Explain what migrations are and why they are useful in NestJS projects.
Think about how you keep your database organized and consistent.
You got /4 concepts.
Describe the typical workflow for creating and running migrations using TypeORM in NestJS.
Consider the steps from writing to applying migrations.
You got /4 concepts.