1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #31477 -- Removed "using" argument from DatabaseOperations.execute_sql_flush().

This commit is contained in:
Jon Dufresne
2020-04-19 22:49:35 -07:00
committed by GitHub
parent 661e39c8d5
commit 5673d4b102
5 changed files with 12 additions and 5 deletions

View File

@@ -400,9 +400,12 @@ class BaseDatabaseOperations:
"""
raise NotImplementedError('subclasses of BaseDatabaseOperations must provide a sql_flush() method')
def execute_sql_flush(self, using, sql_list):
def execute_sql_flush(self, sql_list):
"""Execute a list of SQL statements to flush the database."""
with transaction.atomic(using=using, savepoint=self.connection.features.can_rollback_ddl):
with transaction.atomic(
using=self.connection.alias,
savepoint=self.connection.features.can_rollback_ddl,
):
with self.connection.cursor() as cursor:
for sql in sql_list:
cursor.execute(sql)