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

[1.7.x] Fixed #23426 -- Don't require double percent sign in RunSQL without parameters

Backport of b9a670b227 from master
This commit is contained in:
Markus Holtermann
2014-09-23 23:17:00 +02:00
committed by Tim Graham
parent cc74d8e02e
commit ae14c75014
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"