¡@

Home 

OpenStack Study: 53bbd27ec841_extra_dhcp_opts_supp.py

OpenStack Index

**** CubicPower OpenStack Study ****

def upgrade(active_plugins=None, options=None):

    if not migration.should_run(active_plugins, migration_for_plugins):

        return

    op.create_table(

        'extradhcpopts',

        sa.Column('id', sa.String(length=36), nullable=False),

        sa.Column('port_id', sa.String(length=36), nullable=False),

        sa.Column('opt_name', sa.String(length=64), nullable=False),

        sa.Column('opt_value', sa.String(length=255), nullable=False),

        sa.ForeignKeyConstraint(['port_id'], ['ports.id'], ondelete='CASCADE'),

        sa.PrimaryKeyConstraint('id'),

        sa.UniqueConstraint('port_id', 'opt_name', name='uidx_portid_optname'))

**** CubicPower OpenStack Study ****

def downgrade(active_plugins=None, options=None):

    if not migration.should_run(active_plugins, migration_for_plugins):

        return

    ### commands auto generated by Alembic - please adjust! ###

    op.drop_table('extradhcpopts')

    ### end Alembic commands ###