Fix Postgres alter table
This commit is contained in:
parent
3b4d9b47ce
commit
af4d4be19a
@ -5,6 +5,7 @@
|
|||||||
### 0.2.4
|
### 0.2.4
|
||||||
|
|
||||||
- Raise error with SQLite unsupported features.
|
- Raise error with SQLite unsupported features.
|
||||||
|
- Fix Postgres alter table. (#48)
|
||||||
|
|
||||||
### 0.2.3
|
### 0.2.3
|
||||||
|
|
||||||
|
@ -291,6 +291,11 @@ class Migrate:
|
|||||||
cls._add_operator(
|
cls._add_operator(
|
||||||
cls._set_comment(new_model, new_field), upgrade=upgrade
|
cls._set_comment(new_model, new_field), upgrade=upgrade
|
||||||
)
|
)
|
||||||
|
if new_field.field_type != old_field.field_type:
|
||||||
|
cls._add_operator(
|
||||||
|
cls._modify_field(new_model, new_field), upgrade=upgrade
|
||||||
|
)
|
||||||
|
else:
|
||||||
cls._add_operator(cls._modify_field(new_model, new_field), upgrade=upgrade)
|
cls._add_operator(cls._modify_field(new_model, new_field), upgrade=upgrade)
|
||||||
if (old_field.index and not new_field.index) or (
|
if (old_field.index and not new_field.index) or (
|
||||||
old_field.unique and not new_field.unique
|
old_field.unique and not new_field.unique
|
||||||
|
Loading…
x
Reference in New Issue
Block a user