Ticket #25618: django_style_migrations_fix.diff

File django_style_migrations_fix.diff, 1.2 KB (added by David Filipovic, 9 years ago)
  • django/db/migrations/loader.py

    diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py
    index 35266a7..cbfb11a 100644
    a b class MigrationLoader(object):  
    9797                        migration_names.add(import_name)
    9898            # Load them
    9999            south_style_migrations = False
     100            django_style_migrations = False
    100101            for migration_name in migration_names:
    101102                try:
    102103                    migration_module = import_module("%s.%s" % (module_name, migration_name))
    class MigrationLoader(object):  
    115116                    south_style_migrations = True
    116117                    break
    117118                self.disk_migrations[app_config.label, migration_name] = migration_module.Migration(migration_name, app_config.label)
     119                django_style_migrations = True
     120
    118121            if south_style_migrations:
    119                 if app_config.label in self.migrated_apps:
     122                if south_style_migrations and django_style_migrations:
    120123                    raise BadMigrationError(
    121124                        "Migrated app %r contains South migrations. Make sure "
    122125                        "all numbered South migrations are deleted prior to "
Back to Top