Bird
0
0

If you run flask db migrate but forget to run flask db upgrade, what is the state of the database?

medium📝 component behavior Q5 of 15
Flask - Deployment
If you run flask db migrate but forget to run flask db upgrade, what is the state of the database?
ADatabase is corrupted
BDatabase schema is updated partially
CDatabase schema remains unchanged
DDatabase schema is fully updated
Step-by-Step Solution
Solution:
  1. Step 1: Understand migrate command

    "flask db migrate" only creates migration scripts, it does not change the database.
  2. Step 2: Understand upgrade command necessity

    Only "flask db upgrade" applies the migration scripts to the database schema.
  3. Final Answer:

    Database schema remains unchanged -> Option C
  4. Quick Check:

    Migrate alone = no schema change [OK]
Quick Trick: Always run upgrade after migrate to apply changes [OK]
Common Mistakes:
MISTAKES
  • Assuming migrate updates schema
  • Believing partial updates happen automatically
  • Thinking database corruption occurs

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes