Practice schema migration vocabulary: NOT NULL columns without defaults, backward-compatible migrations, zero-downtime changes, rollback vocabulary, and migration timing in production.
0 / 29 completed
1 / 29
A code reviewer flags: 'This migration adds a ___ column without a default.' Why is this dangerous?
Adding a NOT NULL column without a default value fails on non-empty tables because existing rows cannot satisfy the constraint. The fix is to add the column as nullable first, backfill data, then add the constraint in a separate migration.
2 / 29
The migration is ___ compatible: the old application version can still read the database during rollout.
A backward-compatible migration ensures that the previous version of the application continues to work while the new version is being deployed. This is essential for rolling deployments — old pods and new pods run simultaneously.
3 / 29
The ops team requires a ___ schema change for all production migrations. What does this demand?
A zero-downtime schema change uses techniques like adding nullable columns, online DDL, or multi-step migrations to avoid locking tables or restarting the database, keeping the application available throughout.
4 / 29
After a failed deployment the team executes the migration ___. What does this operation do?
A migration rollback is a prepared script (or automated reversal) that undoes the schema changes introduced by the migration. Not all migrations are safely reversible — for example, dropping a column cannot be rolled back without restoring data.
5 / 29
The deployment log shows: 'The migration ran in 14 seconds on ___.' Why does production timing matter?
'The migration ran in 14 seconds on prod' is a key data point because production tables are far larger than development or staging tables. A migration that takes seconds in testing may lock a production table for minutes, causing downtime.
6 / 29
Sarah: 'Okay, I've reviewed this migration PR. It's pushing a new `user_status` column to the `users` table. Shouldn't we be providing a default value for that column? It seems like users might suddenly be marked as 'inactive' without any prior notice.'
What is Sarah highlighting in her comment?
Sarah is correctly pointing out a critical best practice regarding schema migrations. Providing default values for new columns ensures data integrity and prevents unexpected application behavior; without one, existing records could be unintentionally modified or marked as invalid. This highlights the importance of considering potential data consequences during migration design, not just technical implementation.
7 / 29
Sarah: 'Okay, I've reviewed this migration PR. It's pushing a new `user_status` column to the `users` table. Shouldn't we be providing a default value for that column? It seems like users might suddenly be marked as 'inactive' without any prior notice.'
What is Sarah highlighting in her comment?
Sarah is correctly pointing out a critical best practice regarding schema migrations. Providing default values for new columns ensures data integrity and prevents unexpected application behavior; without one, existing records could be unintentionally modified or marked as invalid. This highlights the importance of considering potential data consequences during migration design, not just technical implementation.
8 / 29
Sarah: 'Okay, I've reviewed this migration PR. It's pushing a new `user_status` column to the `users` table. Shouldn't we be providing a default value for that column? It seems like users might suddenly be marked as 'inactive' without any prior notice.'
What is Sarah highlighting in her comment?
Sarah is correctly pointing out a critical best practice regarding schema migrations. Providing default values for new columns ensures data integrity and prevents unexpected application behavior; without one, existing records could be unintentionally modified or marked as invalid. This highlights the importance of considering potential data consequences during migration design, not just technical implementation.
9 / 29
Sarah: 'Okay, I've reviewed this migration PR. It's pushing a new `user_status` column to the `users` table. Shouldn't we be providing a default value for that column? It seems like users might suddenly be marked as 'inactive' without any prior notice.'
What is Sarah highlighting in her comment?
Sarah is correctly pointing out a critical best practice regarding schema migrations. Providing default values for new columns ensures data integrity and prevents unexpected application behavior; without one, existing records could be unintentionally modified or marked as invalid. This highlights the importance of considering potential data consequences during migration design, not just technical implementation.
10 / 29
Code Review Comment: "Mark reported that the migration script is throwing a 'Column not found' error when attempting to update the `products` table. He suspects the schema definition isn't fully propagated during the rollout. What is Mark most likely referring to?"
Mark is concerned with forward compatibility. This means the older application needs to be able to continue working *after* the schema migration has been applied. A 'Column not found' error indicates a discrepancy between the expected schema and the actual schema, often due to incomplete rollout or misconfiguration during the upgrade process. Options C and D relate to specific rollback strategies or validation processes, but don't address the core issue of compatibility.
11 / 29
Slack Message: "@john.doe - Just noticed the migration PR includes a `version` column in the `users` table. Seems excessive for just tracking schema changes. Should we consider alternative approaches?"
The question highlights an unnecessary element – the `version` column. It's a common practice to use feature flags or rely on database triggers for automatic versioning. Simply adding a timestamp (option A) doesn't address the core concern of managing schema changes effectively and can introduce complexities. Option B is a potential workaround, but not the most efficient solution.
12 / 29
API Response: {
"status": "success",
"message": "Migration completed successfully. Schema updated to version 2.1.",
"timestamp": "2024-10-27T10:30:00Z",
"affected_tables": [
"users",
"products"
]
}
What does the 'affected_tables' field primarily indicate?"
The `affected_tables` field provides a record of *which* tables were impacted by the migration. While it doesn't dictate the order (option A) or specify table versions (option D), it's crucial information for monitoring and troubleshooting schema changes. Option B is irrelevant to the core question, and option C is redundant as the response already states that the version number is 2.1.
13 / 29
PR Description: "This PR introduces a new `created_at` timestamp column to the `orders` table as part of the schema migration. This allows us to track order creation times for reporting purposes. The migration script ensures that this column is added with a default value of '2024-01-01 00:00:00'."
The PR description focuses on the purpose of adding a `created_at` timestamp. The key aspect highlighted is the *default value* being provided. Option A describes a concurrency issue (race condition), which isn't directly related to the default value. Options B and C represent potential side effects or performance improvements, not the core reason for providing a default.
14 / 29
Standup Update: "I'm working on rolling out the new schema migration. The initial run took 25 seconds on the staging server, but it's now taking 45 seconds on production. What does this difference suggest?"
The difference in timing (25 seconds vs. 45 seconds) strongly suggests higher network latency between the application and the database server in the production environment. While options A and D could contribute to performance issues, they don't directly explain the *change* in timing observed. Optimizing the script (option C) is a potential solution, but diagnosing the root cause of the increased latency is more critical.
15 / 29
Code Review Comment: "Mark reported that the migration script is throwing a 'Column not found' error when attempting to update the `products` table. He suspects the schema definition isn't fully propagated during the rollout. What is Mark most likely referring to?"
Mark is concerned with forward compatibility. This means the older application needs to be able to continue working *after* the schema migration has been applied. A 'Column not found' error indicates a discrepancy between the expected schema and the actual schema, often due to incomplete rollout or misconfiguration during the upgrade process. Options C and D relate to specific rollback strategies or validation processes, but don't address the core issue of compatibility.
16 / 29
Slack Message: "@john.doe - Just noticed the migration PR includes a `version` column in the `users` table. Seems excessive for just tracking schema changes. Should we consider alternative approaches?"
The question highlights an unnecessary element – the `version` column. It's a common practice to use feature flags or rely on database triggers for automatic versioning. Simply adding a timestamp (option A) doesn't address the core concern of managing schema changes effectively and can introduce complexities. Option B is a potential workaround, but not the most efficient solution.
17 / 29
API Response: {
"status": "success",
"message": "Migration completed successfully. Schema updated to version 2.1.",
"timestamp": "2024-10-27T10:30:00Z",
"affected_tables": [
"users",
"products"
]
}
What does the 'affected_tables' field primarily indicate?"
The `affected_tables` field provides a record of *which* tables were impacted by the migration. While it doesn't dictate the order (option A) or specify table versions (option D), it's crucial information for monitoring and troubleshooting schema changes. Option B is irrelevant to the core question, and option C is redundant as the response already states that the version number is 2.1.
18 / 29
PR Description: "This PR introduces a new `created_at` timestamp column to the `orders` table as part of the schema migration. This allows us to track order creation times for reporting purposes. The migration script ensures that this column is added with a default value of '2024-01-01 00:00:00'."
The PR description focuses on the purpose of adding a `created_at` timestamp. The key aspect highlighted is the *default value* being provided. Option A describes a concurrency issue (race condition), which isn't directly related to the default value. Options B and C represent potential side effects or performance improvements, not the core reason for providing a default.
19 / 29
Standup Update: "I'm working on rolling out the new schema migration. The initial run took 25 seconds on the staging server, but it's now taking 45 seconds on production. What does this difference suggest?"
The difference in timing (25 seconds vs. 45 seconds) strongly suggests higher network latency between the application and the database server in the production environment. While options A and D could contribute to performance issues, they don't directly explain the *change* in timing observed. Optimizing the script (option C) is a potential solution, but diagnosing the root cause of the increased latency is more critical.
20 / 29
Code Review Comment: "Mark reported that the migration script is throwing a 'Column not found' error when attempting to update the `products` table. He suspects the schema definition isn't fully propagated during the rollout. What is Mark most likely referring to?"
Mark is concerned with forward compatibility. This means the older application needs to be able to continue working *after* the schema migration has been applied. A 'Column not found' error indicates a discrepancy between the expected schema and the actual schema, often due to incomplete rollout or misconfiguration during the upgrade process. Options C and D relate to specific rollback strategies or validation processes, but don't address the core issue of compatibility.
21 / 29
Slack Message: "@john.doe - Just noticed the migration PR includes a `version` column in the `users` table. Seems excessive for just tracking schema changes. Should we consider alternative approaches?"
The question highlights an unnecessary element – the `version` column. It's a common practice to use feature flags or rely on database triggers for automatic versioning. Simply adding a timestamp (option A) doesn't address the core concern of managing schema changes effectively and can introduce complexities. Option B is a potential workaround, but not the most efficient solution.
22 / 29
API Response: {
"status": "success",
"message": "Migration completed successfully. Schema updated to version 2.1.",
"timestamp": "2024-10-27T10:30:00Z",
"affected_tables": [
"users",
"products"
]
}
What does the 'affected_tables' field primarily indicate?"
The `affected_tables` field provides a record of *which* tables were impacted by the migration. While it doesn't dictate the order (option A) or specify table versions (option D), it's crucial information for monitoring and troubleshooting schema changes. Option B is irrelevant to the core question, and option C is redundant as the response already states that the version number is 2.1.
23 / 29
PR Description: "This PR introduces a new `created_at` timestamp column to the `orders` table as part of the schema migration. This allows us to track order creation times for reporting purposes. The migration script ensures that this column is added with a default value of '2024-01-01 00:00:00'."
The PR description focuses on the purpose of adding a `created_at` timestamp. The key aspect highlighted is the *default value* being provided. Option A describes a concurrency issue (race condition), which isn't directly related to the default value. Options B and C represent potential side effects or performance improvements, not the core reason for providing a default.
24 / 29
Standup Update: "I'm working on rolling out the new schema migration. The initial run took 25 seconds on the staging server, but it's now taking 45 seconds on production. What does this difference suggest?"
The difference in timing (25 seconds vs. 45 seconds) strongly suggests higher network latency between the application and the database server in the production environment. While options A and D could contribute to performance issues, they don't directly explain the *change* in timing observed. Optimizing the script (option C) is a potential solution, but diagnosing the root cause of the increased latency is more critical.
25 / 29
Code Review Comment: "Mark reported that the migration script is throwing a 'Column not found' error when attempting to update the `products` table. He suspects the schema definition isn't fully propagated during the rollout. What is Mark most likely referring to?"
Mark is concerned with forward compatibility. This means the older application needs to be able to continue working *after* the schema migration has been applied. A 'Column not found' error indicates a discrepancy between the expected schema and the actual schema, often due to incomplete rollout or misconfiguration during the upgrade process. Options C and D relate to specific rollback strategies or validation processes, but don't address the core issue of compatibility.
26 / 29
Slack Message: "@john.doe - Just noticed the migration PR includes a `version` column in the `users` table. Seems excessive for just tracking schema changes. Should we consider alternative approaches?"
The question highlights an unnecessary element – the `version` column. It's a common practice to use feature flags or rely on database triggers for automatic versioning. Simply adding a timestamp (option A) doesn't address the core concern of managing schema changes effectively and can introduce complexities. Option B is a potential workaround, but not the most efficient solution.
27 / 29
API Response: {
"status": "success",
"message": "Migration completed successfully. Schema updated to version 2.1.",
"timestamp": "2024-10-27T10:30:00Z",
"affected_tables": [
"users",
"products"
]
}
What does the 'affected_tables' field primarily indicate?"
The `affected_tables` field provides a record of *which* tables were impacted by the migration. While it doesn't dictate the order (option A) or specify table versions (option D), it's crucial information for monitoring and troubleshooting schema changes. Option B is irrelevant to the core question, and option C is redundant as the response already states that the version number is 2.1.
28 / 29
PR Description: "This PR introduces a new `created_at` timestamp column to the `orders` table as part of the schema migration. This allows us to track order creation times for reporting purposes. The migration script ensures that this column is added with a default value of '2024-01-01 00:00:00'."
The PR description focuses on the purpose of adding a `created_at` timestamp. The key aspect highlighted is the *default value* being provided. Option A describes a concurrency issue (race condition), which isn't directly related to the default value. Options B and C represent potential side effects or performance improvements, not the core reason for providing a default.
29 / 29
Standup Update: "I'm working on rolling out the new schema migration. The initial run took 25 seconds on the staging server, but it's now taking 45 seconds on production. What does this difference suggest?"
The difference in timing (25 seconds vs. 45 seconds) strongly suggests higher network latency between the application and the database server in the production environment. While options A and D could contribute to performance issues, they don't directly explain the *change* in timing observed. Optimizing the script (option C) is a potential solution, but diagnosing the root cause of the increased latency is more critical.
What does the "Schema Migration Vocabulary" exercise practise?
Practice schema migration vocabulary: NOT NULL columns without defaults, backward-compatible migrations, zero-downtime changes, rollback vocabulary, and migration timing in production.
How many questions are in this exercise?
This exercise has 29 questions, each multiple-choice with a full explanation shown after you answer.
What English level is this exercise for?
This exercise is tagged Intermediate. If the vocabulary feels difficult, browse the Database Schema Design category page for an easier module to start with.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free with no account, sign-up, or paywall.
Do I get feedback if I answer incorrectly?
Yes — whichever option you choose, right or wrong, you'll immediately see an explanation clarifying the correct term and why the other options don't fit.
Can I retry this exercise?
Yes — once you finish all the questions, a "Try again" button on the results screen resets the exercise so you can practise as many times as you like.
Do I need an account to track my progress?
No account is required. Your progress bar and score for this session are tracked in the browser as you go, but nothing is saved once you leave the page.
Is "Schema Migration Vocabulary" part of a larger series?
Yes — it's one exercise in the Database Schema Design category on CoderSlingo. See the category page for the full list of related exercises on similar terminology.
Can I link directly to this exercise?
Yes — this exercise has its own permanent URL, so you can bookmark it or share the link directly with a colleague or study partner.
Where can I find more exercises like this one?
See the Database Schema Design category page for related exercises, or browse the main Exercises hub for other IT English topics.