class MigrationRecorder:
Deal with storing migration records in the database.
Because this table is actually itself used for dealing with model creation, it's the one thing we can't do normally via migrations. We manually handle table creation/schema updating (using schema backend) and then have a floating model to do queries with.
If a migration is unapplied its row is removed from the table. Having a row in the table always means a migration is applied.
Method | __init__ |
Undocumented |
Method | applied_migrations |
Return a dict mapping (app_name, migration_name) to Migration instances for all applied migrations. |
Method | ensure_schema |
Ensure the table exists and has the correct schema. |
Method | flush |
Delete all migration records. Useful for testing migrations. |
Method | has_table |
Return True if the django_migrations table exists. |
Method | record_applied |
Record that a migration was applied. |
Method | record_unapplied |
Record that a migration was unapplied. |
Class Variable | _migration_class |
Undocumented |
Instance Variable | connection |
Undocumented |
Property | Migration |
Lazy load to avoid AppRegistryNotReady if installed apps import MigrationRecorder. |
Property | migration_qs |
Undocumented |