1
0
mirror of https://github.com/django/django.git synced 2025-10-27 07:36:08 +00:00

Fixed #23426 -- Don't require double percent sign in RunSQL without parameters

This commit is contained in:
Markus Holtermann
2014-09-23 23:17:00 +02:00
committed by Tim Graham
parent 0aca91cf7f
commit b9a670b227
4 changed files with 25 additions and 5 deletions

View File

@@ -66,14 +66,14 @@ class RunSQL(Operation):
def database_forwards(self, app_label, schema_editor, from_state, to_state):
statements = schema_editor.connection.ops.prepare_sql_script(self.sql)
for statement in statements:
schema_editor.execute(statement)
schema_editor.execute(statement, params=None)
def database_backwards(self, app_label, schema_editor, from_state, to_state):
if self.reverse_sql is None:
raise NotImplementedError("You cannot reverse this operation")
statements = schema_editor.connection.ops.prepare_sql_script(self.reverse_sql)
for statement in statements:
schema_editor.execute(statement)
schema_editor.execute(statement, params=None)
def describe(self):
return "Raw SQL operation"