**** CubicPower OpenStack Study ****
def upgrade(migrate_engine):
# Upgrade operations go here. Don't create your own engine; bind
meta = sql.MetaData()
meta.bind = migrate_engine
token = sql.Table('token', meta, autoload=True)
# creating the column immediately with nullable=False fails with
# PostgreSQL (LP 1068181), so do it in two steps instead
valid = sql.Column(
'valid', sql.Boolean(), sql.ColumnDefault(True), nullable=True)
valid.create(token, populate_default=True)
valid.alter(type=sql.Boolean(), default=True, nullable=False)
**** CubicPower OpenStack Study ****
def downgrade(migrate_engine):
meta = sql.MetaData()
meta.bind = migrate_engine
token = sql.Table('token', meta, autoload=True)
token.drop_column('valid')