From 65bff161ffab1310719bdee495d1e9b35f838c31 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 27 Oct 2015 14:20:06 -0400 Subject: [PATCH] [1.8.x] Fixed #25618 -- Added a helpful error message when Django & south migrations exist in the same directory. --- django/db/migrations/loader.py | 6 ++++++ docs/releases/1.8.6.txt | 3 +++ 2 files changed, 9 insertions(+) diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py index e824728f2b..35266a7f62 100644 --- a/django/db/migrations/loader.py +++ b/django/db/migrations/loader.py @@ -116,6 +116,12 @@ class MigrationLoader(object): break self.disk_migrations[app_config.label, migration_name] = migration_module.Migration(migration_name, app_config.label) if south_style_migrations: + if app_config.label in self.migrated_apps: + raise BadMigrationError( + "Migrated app %r contains South migrations. Make sure " + "all numbered South migrations are deleted prior to " + "creating Django migrations." % app_config.label + ) self.unmigrated_apps.add(app_config.label) def get_migration(self, app_label, name_prefix): diff --git a/docs/releases/1.8.6.txt b/docs/releases/1.8.6.txt index 75bd79542b..76eb32902d 100644 --- a/docs/releases/1.8.6.txt +++ b/docs/releases/1.8.6.txt @@ -41,3 +41,6 @@ Bugfixes * Fixed crash with ``contrib.postgres.forms.SplitArrayField`` and ``IntegerField`` on invalid value (:ticket:`25597`). + +* Added a helpful error message when Django and South migrations exist in the + same directory (:ticket:`25618`).