Challenge - 5 Problems
Migration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
What does the
makemigrations command do in Django?Choose the correct description of what happens when you run
python manage.py makemigrations.Attempts:
2 left
💡 Hint
Think about which command prepares changes but does not apply them yet.
✗ Incorrect
The makemigrations command looks at your Django models and creates migration files that describe the changes. It does not change the database itself.
🧠 Conceptual
intermediate1:30remaining
What is the purpose of the
migrate command in Django?Select the correct explanation of what
python manage.py migrate does.Attempts:
2 left
💡 Hint
This command changes the database structure based on migration files.
✗ Incorrect
The migrate command reads migration files and applies them to the database, updating tables and schema accordingly.
❓ component_behavior
advanced2:00remaining
What will happen if you run
migrate without running makemigrations after changing models?Consider you changed a model but only run
python manage.py migrate. What is the outcome?Attempts:
2 left
💡 Hint
Think about what
migrate uses to update the database.✗ Incorrect
Without new migration files created by makemigrations, migrate has no instructions to apply, so the database stays unchanged.
🔧 Debug
advanced2:00remaining
You ran
makemigrations but no migration file was created. What could be the reason?Which of the following is the most likely cause for
makemigrations not generating a migration file?Attempts:
2 left
💡 Hint
Django only tracks models for apps listed in settings.
✗ Incorrect
If the app is not listed in INSTALLED_APPS, Django ignores its models and does not create migrations.
📝 Syntax
expert2:30remaining
What error will this command produce if run in a Django project with no migrations folder?
python manage.py migrateAssuming the project has no migrations folder or migration files yet, what will happen when you run
python manage.py migrate?Attempts:
2 left
💡 Hint
Django has built-in migrations for its core apps.
✗ Incorrect
Even if your app has no migrations, Django applies migrations for built-in apps like auth and admin. It does not error if your app lacks migrations.