Loading django/core/management/commands/makemigrations.py +3 −4 Original line number Diff line number Diff line Loading @@ -50,10 +50,9 @@ class Command(BaseCommand): self.stderr.write("App '%s' could not be found. Is it in INSTALLED_APPS?" % app_label) sys.exit(2) # Load the current graph state. Takes a connection, but it's not used # (makemigrations doesn't look at the database state). # Also make sure the graph is built without unmigrated apps shoehorned in. loader = MigrationLoader(connections[DEFAULT_DB_ALIAS]) # Load the current graph state. Pass in None for the connection so # the loader doesn't try to resolve replaced migrations from DB. loader = MigrationLoader(None) # Before anything else, see if there's conflicting apps and drop out # hard if there are any and they don't want to merge Loading django/db/migrations/loader.py +5 −2 Original line number Diff line number Diff line Loading @@ -143,6 +143,9 @@ class MigrationLoader(object): # Load disk data self.load_disk() # Load database data if self.connection is None: self.applied_migrations = set() else: recorder = MigrationRecorder(self.connection) self.applied_migrations = recorder.applied_migrations() # Do a first pass to separate out replacing and non-replacing migrations Loading Loading
django/core/management/commands/makemigrations.py +3 −4 Original line number Diff line number Diff line Loading @@ -50,10 +50,9 @@ class Command(BaseCommand): self.stderr.write("App '%s' could not be found. Is it in INSTALLED_APPS?" % app_label) sys.exit(2) # Load the current graph state. Takes a connection, but it's not used # (makemigrations doesn't look at the database state). # Also make sure the graph is built without unmigrated apps shoehorned in. loader = MigrationLoader(connections[DEFAULT_DB_ALIAS]) # Load the current graph state. Pass in None for the connection so # the loader doesn't try to resolve replaced migrations from DB. loader = MigrationLoader(None) # Before anything else, see if there's conflicting apps and drop out # hard if there are any and they don't want to merge Loading
django/db/migrations/loader.py +5 −2 Original line number Diff line number Diff line Loading @@ -143,6 +143,9 @@ class MigrationLoader(object): # Load disk data self.load_disk() # Load database data if self.connection is None: self.applied_migrations = set() else: recorder = MigrationRecorder(self.connection) self.applied_migrations = recorder.applied_migrations() # Do a first pass to separate out replacing and non-replacing migrations Loading