File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
piccolo/apps/migrations/auto Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -73,12 +73,23 @@ def get_snapshot(self) -> t.List[DiffableTable]:
7373 table .class_name
7474 )
7575 for alter_column in alter_columns :
76- for column in table .columns :
76+ for index , column in enumerate ( table .columns ) :
7777 if column ._meta .name == alter_column .column_name :
7878 for key , value in alter_column .params .items ():
7979 setattr (column ._meta , key , value )
8080 column ._meta .params .update ({key : value })
8181
82+ # If the column type has changed, we need to update
83+ # it.
84+ if (
85+ alter_column .column_class
86+ != alter_column .old_column_class
87+ ):
88+ if alter_column .column_class is not None :
89+ new_column = alter_column .column_class ()
90+ new_column ._meta = column ._meta
91+ table .columns [index ] = new_column
92+
8293 ###############################################################
8394
8495 for (
You can’t perform that action at this time.
0 commit comments