class documentation

class MigrationRecorder: (source)

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.
Instance Variable connection Undocumented
Property Migration Lazy load to avoid AppRegistryNotReady if installed apps import MigrationRecorder.
Property migration_qs Undocumented
Class Variable _migration_class Undocumented
def __init__(self, connection): (source)

Undocumented

def applied_migrations(self): (source)

Return a dict mapping (app_name, migration_name) to Migration instances for all applied migrations.

def ensure_schema(self): (source)

Ensure the table exists and has the correct schema.

def flush(self): (source)

Delete all migration records. Useful for testing migrations.

def has_table(self): (source)

Return True if the django_migrations table exists.

def record_applied(self, app, name): (source)

Record that a migration was applied.

def record_unapplied(self, app, name): (source)

Record that a migration was unapplied.

connection = (source)

Undocumented

Lazy load to avoid AppRegistryNotReady if installed apps import MigrationRecorder.

@property
migration_qs = (source)

Undocumented

_migration_class = (source)

Undocumented