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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user