summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/db/backends/schema.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/django/db/backends/schema.py b/django/db/backends/schema.py
index 64ba5b0740..4fc6601dfd 100644
--- a/django/db/backends/schema.py
+++ b/django/db/backends/schema.py
@@ -93,7 +93,11 @@ class BaseDatabaseSchemaEditor(object):
# Log the command we're running, then run it
logger.debug("%s; (params %r)" % (sql, params))
if self.collect_sql:
- self.collected_sql.append((sql % tuple(map(self.quote_value, params))) + ";")
+ ending = "" if sql.endswith(";") else ";"
+ if params is not None:
+ self.collected_sql.append((sql % tuple(map(self.quote_value, params))) + ending)
+ else:
+ self.collected_sql.append(sql + ending)
else:
with self.connection.cursor() as cursor:
cursor.execute(sql, params)