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:
committed by
Tim Graham
parent
12bace46c1
commit
40ad022d5e
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user