Recall & Review
beginner
What is the purpose of Prisma migrations in a NestJS project?
Prisma migrations help manage and apply changes to the database schema in a safe and organized way. They keep the database structure in sync with your Prisma schema file.
Click to reveal answer
beginner
Which command creates a new migration file after updating the Prisma schema?
The command
npx prisma migrate dev --name your_migration_name creates a new migration file and applies it to the database during development.Click to reveal answer
intermediate
How does Prisma ensure migrations are applied in the correct order?
Prisma stores migration history in a special table in the database. It applies migrations sequentially based on this history to keep the database consistent.
Click to reveal answer
intermediate
What should you do before running migrations in a production environment?
You should review migration files carefully, back up your database, and run
npx prisma migrate deploy to apply migrations safely without prompts.Click to reveal answer
beginner
Why is it important to commit migration files to version control?
Committing migration files lets your team share database changes and ensures everyone applies the same schema updates, avoiding conflicts and errors.
Click to reveal answer
Which Prisma command applies migrations during development and updates the database?
✗ Incorrect
The
migrate dev command creates and applies migrations during development.Where does Prisma store the migration history to track applied migrations?
✗ Incorrect
Prisma uses a dedicated table in the database to track migration history.
What is the recommended command to apply migrations in a production environment?
✗ Incorrect
The
migrate deploy command applies migrations safely in production.Why should migration files be committed to version control?
✗ Incorrect
Committing migration files helps the team stay in sync with database changes.
What happens if you change the Prisma schema but do not create a migration?
✗ Incorrect
Without creating a migration, the database schema stays unchanged.
Explain the steps to create and apply a new Prisma migration in a NestJS project.
Think about how you change the schema and then update the database safely.
You got /5 concepts.
Describe how Prisma migrations help keep your database consistent across different environments.
Consider how migrations track and share changes to avoid conflicts.
You got /5 concepts.