from south.models import MigrationHistory
from south.migration.base import all_migrations, Migrations
-from south.orm import FakeORM
from south.signals import pre_migrate, post_migrate, ran_migration
klass = migration.migration().Migration
- # Find its predecessor, and attach the ORM from that as prev_orm.
- previous = migration.previous()
- # First migration? The 'previous ORM' is empty.
- klass.prev_orm = FakeORM(None, app)
- klass.prev_orm = previous.migration().Migration.orm
# If this is a 'fake' migration, do nothing.
args = inspect.getargspec(runfunc)
if self.torun == 'forwards':
+ orm = .prev_orm
# If the database doesn't support running DDL inside a transaction
# *cough*MySQL*cough* then do a dry run first.
print ' ! The South developers regret this has happened, and would'
print ' ! like to gently persuade you to consider a slightly'