summaryrefslogtreecommitdiff
path: root/django/db/migrations/executor.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/migrations/executor.py')
-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 83d624e08a..57042a8690 100644
--- a/django/db/migrations/executor.py
+++ b/django/db/migrations/executor.py
@@ -225,8 +225,9 @@ class MigrationExecutor:
# Alright, do it normally
with self.connection.schema_editor(atomic=migration.atomic) as schema_editor:
state = migration.apply(state, schema_editor)
- self.record_migration(migration)
- migration_recorded = True
+ if not schema_editor.deferred_sql:
+ self.record_migration(migration)
+ migration_recorded = True
if not migration_recorded:
self.record_migration(migration)
# Report progress