**** CubicPower OpenStack Study ****
def upgrade(migrate_engine):
meta = MetaData()
meta.bind = migrate_engine
# Add a new column metrics to save metrics info for compute nodes
compute_nodes = Table('compute_nodes', meta, autoload=True)
shadow_compute_nodes = Table('shadow_compute_nodes', meta, autoload=True)
metrics = Column('metrics', Text, nullable=True)
shadow_metrics = Column('metrics', Text, nullable=True)
compute_nodes.create_column(metrics)
shadow_compute_nodes.create_column(shadow_metrics)
**** CubicPower OpenStack Study ****
def downgrade(migrate_engine):
meta = MetaData()
meta.bind = migrate_engine
# Remove the new column
compute_nodes = Table('compute_nodes', meta, autoload=True)
shadow_compute_nodes = Table('shadow_compute_nodes', meta, autoload=True)
compute_nodes.drop_column('metrics')
shadow_compute_nodes.drop_column('metrics')