Seeing What It Actually Does

You can read the SQL. python manage.py sqlmigrate posts 0002 prints exactly what that migration will run, without running it.

This is the fastest way to understand what the ORM is doing, and the best answer to the feeling that migrations are magic. They are not: they are SQL you did not have to write.

showmigrations lists every migration and marks which have been applied. When something is behaving as though the database is from a different era than the code, this is where you look first.

SQLite is the default and it is fine to learn on. It is a file, it needs no server, and it behaves close enough to the alternatives for everything in this course. Production usually means PostgreSQL, and the change is a settings change plus running the migrations again on the new database.

Mark this lesson complete

Signed in, your progress follows you to every device.

Next: Practice Test →
← Back