diff options
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/migrations/executor.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/django/db/migrations/executor.py b/django/db/migrations/executor.py index af2207c9ab..39ed2e4d3d 100644 --- a/django/db/migrations/executor.py +++ b/django/db/migrations/executor.py @@ -180,6 +180,14 @@ class MigrationExecutor(object): def check_replacements(self): """ Mark replacement migrations applied if their replaced set all are. + + We do this unconditionally on every migrate, rather than just when + migrations are applied or unapplied, so as to correctly handle the case + when a new squash migration is pushed to a deployment that already had + all its replaced migrations applied. In this case no new migration will + be applied, but we still want to correctly maintain the applied state + of the squash migration. + """ applied = self.recorder.applied_migrations() for key, migration in self.loader.replacements.items(): |
