summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2013-07-02 11:51:18 +0100
committerAndrew Godwin <andrew@aeracode.org>2013-07-02 11:51:18 +0100
commitf343cbf06cba0e2ace0157224f85b89488093fa1 (patch)
tree726224f5b25cf013e90ef09aaa1ac369ddde392d
parent6a8cfbf07b2ba7e18db4d86aed0111be4457981e (diff)
Fix combined alters on PostgreSQL
-rw-r--r--django/db/backends/schema.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/db/backends/schema.py b/django/db/backends/schema.py
index c8b09f0d99..31ad876be2 100644
--- a/django/db/backends/schema.py
+++ b/django/db/backends/schema.py
@@ -1,10 +1,12 @@
import sys
import hashlib
+import operator
from django.db.backends.creation import BaseDatabaseCreation
from django.db.backends.util import truncate_name
from django.utils.log import getLogger
from django.db.models.fields.related import ManyToManyField
from django.db.transaction import atomic
+from django.utils.six.moves import reduce
logger = getLogger('django.db.backends.schema')
@@ -525,7 +527,7 @@ class BaseDatabaseSchemaEditor(object):
# Combine actions together if we can (e.g. postgres)
if self.connection.features.supports_combined_alters:
sql, params = tuple(zip(*actions))
- actions = [(", ".join(sql), params)]
+ actions = [(", ".join(sql), reduce(operator.add, params))]
# Apply those actions
for sql, params in actions:
self.execute(