Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make db.migrations ignore South-style migrations.

  • Loading branch information...
commit 32838a5beb29fe4f23fa7881e6535b1b7384d39c 1 parent b80be68
@andrewgodwin andrewgodwin authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 django/db/migrations/loader.py
View
11 django/db/migrations/loader.py
@@ -82,9 +82,18 @@ def load_disk(self):
migration_names.add(import_name)
# Load them
for migration_name in migration_names:
- migration_module = import_module("%s.%s" % (module_name, migration_name))
+ try:
+ migration_module = import_module("%s.%s" % (module_name, migration_name))
+ except ImportError as e:
+ # Ignore South import errors, as we're triggering them
+ if "south" in str(e).lower():
+ continue
+ raise
if not hasattr(migration_module, "Migration"):
raise BadMigrationError("Migration %s in app %s has no Migration class" % (migration_name, app_label))
+ # Ignore South-style migrations
+ if hasattr(migration_module.Migration, "forwards"):
+ continue
self.disk_migrations[app_label, migration_name] = migration_module.Migration(migration_name, app_label)
def get_migration_by_prefix(self, app_label, name_prefix):

0 comments on commit 32838a5

Please sign in to comment.
Something went wrong with that request. Please try again.