<s> from sqlalchemy import MetaData , String , Table <EOL> def upgrade ( migrate_engine ) : <EOL> meta = MetaData ( bind = migrate_engine ) <EOL> table = Table ( '<STR_LIT>' , meta , autoload = True ) <EOL> col_resource = getattr ( table . c , '<STR_LIT>' ) <EOL> if col_resource . type . length == <NUM_LIT> : <EOL> col_resource . alter ( type = String ( <NUM_LIT:255> ) ) <EOL> table . update ( ) . where ( table . c . resource == '<STR_LIT>' ) . values ( resource = '<STR_LIT>' ) . execute ( ) </s>
