<s> from migrate . changeset import * <EOL> from sqlalchemy import * <EOL> from glance . registry . db . migrate_repo . schema import ( <EOL> Boolean , DateTime , BigInteger , Integer , String , <EOL> Text , from_migration_import ) <EOL> def get_images_table ( meta ) : <EOL> """<STR_LIT>""" <EOL> images = Table ( '<STR_LIT>' , meta , <EOL> Column ( '<STR_LIT:id>' , Integer ( ) , primary_key = True , nullable = False ) , <EOL> Column ( '<STR_LIT:name>' , String ( <NUM_LIT:255> ) ) , <EOL> Column ( '<STR_LIT>' , String ( <NUM_LIT:20> ) ) , <EOL> Column ( '<STR_LIT>' , String ( <NUM_LIT:20> ) ) , <EOL> Column ( '<STR_LIT:size>' , BigInteger ( ) ) , <EOL> Column ( '<STR_LIT:status>' , String ( <NUM_LIT:30> ) , nullable = False ) , <EOL> Column ( '<STR_LIT>' , Boolean ( ) , nullable = False , default = False , <EOL> index = True ) , <EOL> Column ( '<STR_LIT:location>' , Text ( ) ) , <EOL> Column ( '<STR_LIT>' , DateTime ( ) , nullable = False ) , <EOL> Column ( '<STR_LIT>' , DateTime ( ) ) , <EOL> Column ( '<STR_LIT>' , DateTime ( ) ) , <EOL> Column ( '<STR_LIT>' , Boolean ( ) , nullable = False , default = False , <EOL> index = True ) , <EOL> mysql_engine = '<STR_LIT>' , <EOL> useexisting = True ) <EOL> return images <EOL> def get_image_properties_table ( meta ) : <EOL> """<STR_LIT>""" <EOL> ( define_image_properties_table , ) = from_migration_import ( <EOL> '<STR_LIT>' , [ '<STR_LIT>' ] ) <EOL> image_properties = define_image_properties_table ( meta ) <EOL> return image_properties <EOL> def upgrade ( migrate_engine ) : <EOL> meta = MetaData ( ) <EOL> meta . bind = migrate_engine <EOL> dialect = migrate_engine . url . get_dialect ( ) . name <EOL> if not dialect . startswith ( '<STR_LIT>' ) : <EOL> ( get_images_table , ) = from_migration_import ( <EOL> '<STR_LIT>' , [ '<STR_LIT>' ] ) <EOL> images = get_images_table ( meta ) <EOL> images . columns [ '<STR_LIT:size>' ] . alter ( type = BigInteger ( ) ) <EOL> def downgrade ( migrate_engine ) : <EOL> meta = MetaData ( ) <EOL> meta . bind = migrate_engine <EOL> dialect = migrate_engine . url . get_dialect ( ) . name <EOL> if not dialect . startswith ( '<STR_LIT>' ) : <EOL> images = get_images_table ( meta ) <EOL> images . columns [ '<STR_LIT:size>' ] . alter ( type = Integer ( ) ) </s>
