How does django know which migrations have been run?

BostonJohn picture BostonJohn · Dec 11, 2014 · Viewed 9.8k times · Source

How does django know whether a migration has been applied yet? It usually gets it right, but when it doesn't I don't ever know where to start troubleshooting.

Answer

mipadi picture mipadi · Dec 11, 2014

Django writes a record into the table django_migrations consisting of some information like the app the migration belongs to, the name of the migration, and the date it was applied.