mirror of
https://github.com/django/django.git
synced 2025-06-05 11:39:13 +00:00
[1.8.x] Fixed #25618 -- Restored migration support for non-upgraded apps.
A non-upgraded app is one that retains South migrations in the `migrations` module and doesn't introduce Django migrations.
This commit is contained in:
parent
f787aaeb26
commit
8c8a6d8a3f
@ -97,6 +97,7 @@ class MigrationLoader(object):
|
|||||||
migration_names.add(import_name)
|
migration_names.add(import_name)
|
||||||
# Load them
|
# Load them
|
||||||
south_style_migrations = False
|
south_style_migrations = False
|
||||||
|
django_style_migrations = False
|
||||||
for migration_name in migration_names:
|
for migration_name in migration_names:
|
||||||
try:
|
try:
|
||||||
migration_module = import_module("%s.%s" % (module_name, migration_name))
|
migration_module = import_module("%s.%s" % (module_name, migration_name))
|
||||||
@ -115,8 +116,10 @@ class MigrationLoader(object):
|
|||||||
south_style_migrations = True
|
south_style_migrations = True
|
||||||
break
|
break
|
||||||
self.disk_migrations[app_config.label, migration_name] = migration_module.Migration(migration_name, app_config.label)
|
self.disk_migrations[app_config.label, migration_name] = migration_module.Migration(migration_name, app_config.label)
|
||||||
|
django_style_migrations = True
|
||||||
|
|
||||||
if south_style_migrations:
|
if south_style_migrations:
|
||||||
if app_config.label in self.migrated_apps:
|
if django_style_migrations:
|
||||||
raise BadMigrationError(
|
raise BadMigrationError(
|
||||||
"Migrated app %r contains South migrations. Make sure "
|
"Migrated app %r contains South migrations. Make sure "
|
||||||
"all numbered South migrations are deleted prior to "
|
"all numbered South migrations are deleted prior to "
|
||||||
|
@ -18,3 +18,6 @@ Bugfixes
|
|||||||
* Fixed a regression in 1.8.6 by restoring the ability to use ``Manager``
|
* Fixed a regression in 1.8.6 by restoring the ability to use ``Manager``
|
||||||
objects for the ``queryset`` argument of ``ModelChoiceField``
|
objects for the ``queryset`` argument of ``ModelChoiceField``
|
||||||
(:ticket:`25683`).
|
(:ticket:`25683`).
|
||||||
|
|
||||||
|
* Fixed a regression in 1.8.6 that caused an application with South migrations
|
||||||
|
in the ``migrations`` directory to fail (:ticket:`25618`).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user