Fix bad conflict detection during makemigrations
This commit is contained in:
parent
8d7e048a8b
commit
28779abb75
|
@ -52,7 +52,7 @@ class Command(BaseCommand):
|
||||||
# Load the current graph state. Takes a connection, but it's not used
|
# Load the current graph state. Takes a connection, but it's not used
|
||||||
# (makemigrations doesn't look at the database state).
|
# (makemigrations doesn't look at the database state).
|
||||||
# Also make sure the graph is built without unmigrated apps shoehorned in.
|
# Also make sure the graph is built without unmigrated apps shoehorned in.
|
||||||
loader = MigrationLoader(connections[DEFAULT_DB_ALIAS])
|
loader = MigrationLoader(connections[DEFAULT_DB_ALIAS], load=False)
|
||||||
loader.build_graph(ignore_unmigrated=True)
|
loader.build_graph(ignore_unmigrated=True)
|
||||||
|
|
||||||
# Before anything else, see if there's conflicting apps and drop out
|
# Before anything else, see if there's conflicting apps and drop out
|
||||||
|
|
|
@ -201,7 +201,6 @@ class MigrationLoader(object):
|
||||||
if parent[1] == "__first__" and parent not in self.graph:
|
if parent[1] == "__first__" and parent not in self.graph:
|
||||||
if parent[0] in self.unmigrated_apps:
|
if parent[0] in self.unmigrated_apps:
|
||||||
if ignore_unmigrated:
|
if ignore_unmigrated:
|
||||||
migration.dependencies.remove(parent)
|
|
||||||
parent = None
|
parent = None
|
||||||
else:
|
else:
|
||||||
# This app isn't migrated, but something depends on it.
|
# This app isn't migrated, but something depends on it.
|
||||||
|
|
Loading…
Reference in New Issue