Bird
0
0

Why is it important to keep migration files under version control when deploying to production?

hard📝 Conceptual Q10 of 15
Django - Deployment and Production
Why is it important to keep migration files under version control when deploying to production?
ATo ensure migrations are applied in the correct order and tracked
BTo allow developers to edit migration files directly in production
CTo prevent Django from creating migration files automatically
DTo avoid running migrations on development machines
Step-by-Step Solution
Solution:
  1. Step 1: Understand migration file role

    Migration files define schema changes and their order.
  2. Step 2: Importance of version control

    Version control tracks changes and ensures consistent deployment across environments.
  3. Final Answer:

    To ensure migrations are applied in the correct order and tracked -> Option A
  4. Quick Check:

    Version control ensures migration order = B [OK]
Quick Trick: Track migration files in version control for consistency [OK]
Common Mistakes:
MISTAKES
  • Editing migrations directly in production
  • Thinking version control stops migration creation
  • Avoiding migrations on dev machines

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes