From 37cde8667e837e4e766a6654595a131b837c7eca Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Fri, 18 Mar 2016 23:06:43 +0100 Subject: [PATCH] Pass type to sql_alter_column*. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This helps databases which need the database type when changing the default (Just like MySQL needs it for changing null…) --- django/db/backends/base/schema.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py index a9d84e114d..3e23cae0f2 100644 --- a/django/db/backends/base/schema.py +++ b/django/db/backends/base/schema.py @@ -577,6 +577,7 @@ class BaseDatabaseSchemaEditor(object): actions.append(( self.sql_alter_column_default % { "column": self.quote_name(new_field.column), + "type": new_type, "default": self.prepare_default(new_default), }, [], @@ -585,6 +586,7 @@ class BaseDatabaseSchemaEditor(object): actions.append(( self.sql_alter_column_default % { "column": self.quote_name(new_field.column), + "type": new_type, "default": "%s", }, [new_default], @@ -738,6 +740,7 @@ class BaseDatabaseSchemaEditor(object): "table": self.quote_name(model._meta.db_table), "changes": self.sql_alter_column_no_default % { "column": self.quote_name(new_field.column), + "type": new_type, } } self.execute(sql)