Skip to main content
Django Bug Hunt Medium +20 XP

Missing Migration

New model field doesn't appear in the database.

DjangoFind the bug
1class Article(models.Model):
2 title = models.CharField(max_length=200)
3 summary = models.TextField() # newly added
The bug is on line 3

Select the correct fix

Show answer and explanation

Answer: Run makemigrations then migrate

After changing a model, run 'python manage.py makemigrations' to create a migration file, then 'migrate' to apply it to the database.

Hint: Model changes need migrations to reach the database.

What this challenge tests

Bug Hunt in Django: migrations, models.

Related challenges