makemigrations vs migrate
How Django plans and applies schema changes.
Two Steps, Not One
Django changes your database in two steps: first it writes a plan, then it runs that plan. Knowing which is which saves a lot of confusion. 🧭
makemigrations Plans
makemigrations looks at your models, spots what changed, and writes a migration file describing the change. It does not touch the database yet.
python manage.py makemigrationsAll lessons in this course
- makemigrations vs migrate
- Reading a Migration File
- Changing a Model and Re-migrating
- sqlmigrate and Inspecting SQL