Skip to content
Browse files

Fix combined alters on PostgreSQL

  • Loading branch information...
1 parent 6a8cfbf commit f343cbf06cba0e2ace0157224f85b89488093fa1 @andrewgodwin andrewgodwin committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 django/db/backends/
4 django/db/backends/
@@ -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 @@ def alter_field(self, model, old_field, new_field, strict=False):
# 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:

0 comments on commit f343cbf

Please sign in to comment.
Something went wrong with that request. Please try again.