¡@

Home 

OpenStack Study: 66a59a7f516_nec_openflow_router.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(

        'ofcroutermappings',

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

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

        sa.PrimaryKeyConstraint('quantum_id'),

        sa.UniqueConstraint('ofc_id'),

    )

    op.create_table(

        'routerproviders',

        sa.Column('provider', sa.String(length=255), nullable=True),

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

        sa.ForeignKeyConstraint(['router_id'], ['routers.id'],

                                ondelete='CASCADE'),

        sa.PrimaryKeyConstraint('router_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('routerproviders')

    op.drop_table('ofcroutermappings')