**** CubicPower OpenStack Study ****
def upgrade(active_plugins=None, options=None):
if not migration.should_run(active_plugins, migration_for_plugins):
return
op.create_table(
'lsn',
sa.Column('net_id',
sa.String(length=36), nullable=False),
sa.Column('lsn_id',
sa.String(length=36), nullable=False),
sa.PrimaryKeyConstraint('lsn_id'))
op.create_table(
'lsn_port',
sa.Column('lsn_port_id',
sa.String(length=36), nullable=False),
sa.Column('lsn_id',
sa.String(length=36), nullable=False),
sa.Column('sub_id',
sa.String(length=36), nullable=False, unique=True),
sa.Column('mac_addr',
sa.String(length=32), nullable=False, unique=True),
sa.ForeignKeyConstraint(['lsn_id'], ['lsn.lsn_id'],
ondelete='CASCADE'),
sa.PrimaryKeyConstraint('lsn_port_id'))
**** CubicPower OpenStack Study ****
def downgrade(active_plugins=None, options=None):
if not migration.should_run(active_plugins, migration_for_plugins):
return
op.drop_table('lsn_port')
op.drop_table('lsn')