1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #27507 -- Used SchemaEditor.execute() to run deferred_sql in migrate's sync_apps().

This commit is contained in:
Lex Berezhny
2016-11-18 17:36:34 -05:00
committed by Tim Graham
parent 71609a5b90
commit 8eb56f3c78
4 changed files with 27 additions and 2 deletions

View File

@@ -312,8 +312,9 @@ class Command(BaseCommand):
if self.verbosity >= 1:
self.stdout.write(" Running deferred SQL...\n")
for statement in deferred_sql:
cursor.execute(statement)
with connection.schema_editor() as editor:
for statement in deferred_sql:
editor.execute(statement)
finally:
cursor.close()