File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
piccolo/apps/migrations/auto Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -340,9 +340,20 @@ async def _run_alter_columns(self, backwards=False):
340340 )
341341 column_name = alter_column .column_name
342342
343+ ###############################################################
344+
343345 # Change the column type if possible
344- column_class = alter_column .column_class
345- old_column_class = alter_column .old_column_class
346+ column_class = (
347+ alter_column .old_column_class
348+ if backwards
349+ else alter_column .column_class
350+ )
351+ old_column_class = (
352+ alter_column .column_class
353+ if backwards
354+ else alter_column .old_column_class
355+ )
356+
346357 if (old_column_class is not None ) and (
347358 column_class is not None
348359 ):
@@ -361,6 +372,8 @@ async def _run_alter_columns(self, backwards=False):
361372 old_column = old_column , new_column = new_column
362373 )
363374
375+ ###############################################################
376+
364377 null = params .get ("null" )
365378 if null is not None :
366379 await _Table .alter ().set_null (
You can’t perform that action at this time.
0 commit comments