Recall & Review
beginner
What is a database migration in the context of Next.js applications?
A database migration is a way to change the database schema over time in a controlled and organized manner. It helps keep the database structure in sync with the application code.
Click to reveal answer
beginner
Why should you use migrations instead of manually changing the database?
Migrations ensure changes are repeatable, trackable, and reversible. They prevent errors from manual edits and help teams work together safely on database changes.
Click to reveal answer
beginner
Which tool is commonly used with Next.js for managing database migrations?
Prisma is a popular tool used with Next.js that provides an easy way to write and run database migrations using its schema and CLI commands.
Click to reveal answer
intermediate
What command do you run to create a new migration with Prisma in a Next.js project?
You run
npx prisma migrate dev --name descriptive_migration_name to create and apply a new migration during development.Click to reveal answer
intermediate
How do migrations help when deploying a Next.js app to production?
Migrations allow you to update the production database schema safely and consistently, ensuring the app and database stay compatible without losing data.
Click to reveal answer
What is the main purpose of a database migration?
✗ Incorrect
Migrations are designed to safely change the database structure as the app evolves.
Which tool integrates well with Next.js for migrations?
✗ Incorrect
Prisma is a database toolkit that works well with Next.js for schema and migrations.
What does the command
npx prisma migrate dev do?✗ Incorrect
This command creates a migration file and applies it to the database in development.
Why is it important to track migrations in version control?
✗ Incorrect
Tracking migrations helps teams stay in sync on database changes.
What happens if you run migrations on a production database?
✗ Incorrect
Migrations update the production database schema without losing data.
Explain what database migrations are and why they are important in Next.js projects.
Think about how your app's data structure changes over time.
You got /3 concepts.
Describe the steps to create and apply a new migration using Prisma in a Next.js app.
Focus on the Prisma CLI commands and schema updates.
You got /4 concepts.