¡@

Home 

OpenStack Study: 020_drop_images_table_location.py

OpenStack Index

**** CubicPower OpenStack Study ****

def get_images_table(meta):

    return sqlalchemy.Table('images', meta, autoload=True)

**** CubicPower OpenStack Study ****

def upgrade(migrate_engine):

    meta = sqlalchemy.schema.MetaData(migrate_engine)

    images_table = get_images_table(meta)

    images_table.columns['location'].drop()

**** CubicPower OpenStack Study ****

def downgrade(migrate_engine):

    meta = sqlalchemy.schema.MetaData(migrate_engine)

    images_table = get_images_table(meta)

    location = sqlalchemy.Column('location', schema.Text())

    location.create(images_table)