From dfae72f45a74b8fe3a08fe0a48c11bfeb9b9efda Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Sun, 22 May 2016 20:35:10 -0400 Subject: [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 --- django/db/migrations/executor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'django') 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 -- cgit v1.3