Pass type to sql_alter_column*.
This helps databases which need the database type when changing the default (Just like MySQL needs it for changing null…)
This commit is contained in:
parent
cacc7e85e1
commit
37cde8667e
|
@ -577,6 +577,7 @@ class BaseDatabaseSchemaEditor(object):
|
||||||
actions.append((
|
actions.append((
|
||||||
self.sql_alter_column_default % {
|
self.sql_alter_column_default % {
|
||||||
"column": self.quote_name(new_field.column),
|
"column": self.quote_name(new_field.column),
|
||||||
|
"type": new_type,
|
||||||
"default": self.prepare_default(new_default),
|
"default": self.prepare_default(new_default),
|
||||||
},
|
},
|
||||||
[],
|
[],
|
||||||
|
@ -585,6 +586,7 @@ class BaseDatabaseSchemaEditor(object):
|
||||||
actions.append((
|
actions.append((
|
||||||
self.sql_alter_column_default % {
|
self.sql_alter_column_default % {
|
||||||
"column": self.quote_name(new_field.column),
|
"column": self.quote_name(new_field.column),
|
||||||
|
"type": new_type,
|
||||||
"default": "%s",
|
"default": "%s",
|
||||||
},
|
},
|
||||||
[new_default],
|
[new_default],
|
||||||
|
@ -738,6 +740,7 @@ class BaseDatabaseSchemaEditor(object):
|
||||||
"table": self.quote_name(model._meta.db_table),
|
"table": self.quote_name(model._meta.db_table),
|
||||||
"changes": self.sql_alter_column_no_default % {
|
"changes": self.sql_alter_column_no_default % {
|
||||||
"column": self.quote_name(new_field.column),
|
"column": self.quote_name(new_field.column),
|
||||||
|
"type": new_type,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.execute(sql)
|
self.execute(sql)
|
||||||
|
|
Loading…
Reference in New Issue