Recall & Review
beginner
What is a migration in the context of database schema changes?
A migration is a set of instructions that change the database structure, like adding or removing tables or columns, to keep the database in sync with the application code.
Click to reveal answer
beginner
Why are migrations important in Express applications?
Migrations help manage database changes safely and consistently, allowing developers to update the schema without losing data or causing errors.
Click to reveal answer
intermediate
Name a popular tool used with Express for managing migrations.
Sequelize CLI is a popular tool that helps create, run, and undo migrations in Express apps using Sequelize ORM.
Click to reveal answer
intermediate
What does the 'up' function do in a migration file?
The 'up' function defines the changes to apply to the database schema, like creating tables or adding columns.
Click to reveal answer
intermediate
How does the 'down' function in a migration file help during development?
The 'down' function reverses the changes made by the 'up' function, allowing you to undo migrations if needed.
Click to reveal answer
What is the main purpose of a migration in Express apps?
✗ Incorrect
Migrations are used to update the database schema safely and consistently.
Which tool is commonly used with Express for migrations?
✗ Incorrect
Sequelize CLI is a popular tool for managing migrations in Express apps using Sequelize.
What does the 'up' function in a migration file do?
✗ Incorrect
The 'up' function applies schema changes like creating or modifying tables.
What is the role of the 'down' function in migrations?
✗ Incorrect
The 'down' function undoes the changes made by the 'up' function.
Why should migrations be used instead of manual database changes?
✗ Incorrect
Migrations keep schema changes consistent, trackable, and reversible, avoiding errors.
Explain what a migration is and why it is useful in Express applications.
Think about how you change your database structure without breaking your app.
You got /4 concepts.
Describe the roles of the 'up' and 'down' functions in a migration file.
One function moves forward, the other moves backward.
You got /3 concepts.