class documentation

class MigrationRecorder:

View In Hierarchy

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
def __init__(self, connection):

Undocumented

def applied_migrations(self):
Return a dict mapping (app_name, migration_name) to Migration instances for all applied migrations.
def ensure_schema(self):
Ensure the table exists and has the correct schema.
def flush(self):
Delete all migration records. Useful for testing migrations.
def has_table(self):
Return True if the django_migrations table exists.
def record_applied(self, app, name):
Record that a migration was applied.
def record_unapplied(self, app, name):
Record that a migration was unapplied.
_migration_class =

Undocumented

connection =

Undocumented

@classproperty
Migration =
Lazy load to avoid AppRegistryNotReady if installed apps import MigrationRecorder.
@property
migration_qs =

Undocumented