From 40ad022d5e366f56424dcdb885607d13c00a550e Mon Sep 17 00:00:00 2001 From: Markus Holtermann Date: Fri, 31 Oct 2014 14:08:24 +0100 Subject: [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 --- django/db/backends/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django') diff --git a/django/db/backends/schema.py b/django/db/backends/schema.py index 154f452967..64ba5b0740 100644 --- a/django/db/backends/schema.py +++ b/django/db/backends/schema.py @@ -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 -- cgit v1.3