summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2016-05-22 20:35:10 -0400
committerSimon Charette <charette.s@gmail.com>2016-05-26 13:32:02 -0400
commitdfae72f45a74b8fe3a08fe0a48c11bfeb9b9efda (patch)
tree0316b8a24cb7c97b7c654c74c7620821d90ca9aa /django
parent699e43b017b01ab2ef9f1e7a5a75c50a20956485 (diff)
[1.10.x] Fixed #26647 -- Included the state of all applied migrations when migrating forward.
Thanks Jasper Maes for the detailed report. Backport of 36d36818a30025034cad6f1ee59b2a960a6582ec from master
Diffstat (limited to 'django')
-rw-r--r--django/db/migrations/executor.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/db/migrations/executor.py b/django/db/migrations/executor.py
index 4487543f16..fb9c7a93a4 100644
--- a/django/db/migrations/executor.py
+++ b/django/db/migrations/executor.py
@@ -116,8 +116,8 @@ class MigrationExecutor(object):
if key in self.loader.graph.nodes
}
for migration, _ in full_plan:
- if not migrations_to_run:
- # We remove every migration that we applied from this set so
+ if not migrations_to_run and not applied_migrations:
+ # We remove every migration that we applied from these sets so
# that we can bail out once the last migration has been applied
# and don't always run until the very end of the migration
# process.
@@ -136,6 +136,7 @@ class MigrationExecutor(object):
# to make sure the resulting state doesn't include changes
# from unrelated migrations.
migration.mutate_state(state, preserve=False)
+ applied_migrations.remove(migration)
return state