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

[1.7.x] Fixed #23738 -- Allowed migrating from NULL to NOT NULL with the same default value

Thanks to Andrey Antukh for the report.

Backport of 715ccfde24 from master
This commit is contained in:
Markus Holtermann
2014-10-31 14:08:24 +01:00
committed by Tim Graham
parent 12bace46c1
commit 40ad022d5e
4 changed files with 38 additions and 2 deletions

View File

@@ -613,7 +613,7 @@ class BaseDatabaseSchemaEditor(object):
# directly run a (NOT) NULL alteration
actions = actions + null_actions
# Combine actions together if we can (e.g. postgres)
if self.connection.features.supports_combined_alters:
if self.connection.features.supports_combined_alters and actions:
sql, params = tuple(zip(*actions))
actions = [(", ".join(sql), reduce(operator.add, params))]
# Apply those actions