¡@

Home 

OpenStack Study: 45680af419f9_nvp_qos.py

OpenStack Index

**** CubicPower OpenStack Study ****

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

    if not migration.should_run(active_plugins, migration_for_plugins):

        return

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

    op.create_table(

        'qosqueues',

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

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

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

        sa.Column('default', sa.Boolean(), nullable=True),

        sa.Column('min', sa.Integer(), nullable=False),

        sa.Column('max', sa.Integer(), nullable=True),

        sa.Column('qos_marking', sa.Enum('untrusted', 'trusted',

                                         name='qosqueues_qos_marking'),

                  nullable=True),

        sa.Column('dscp', sa.Integer(), nullable=True),

        sa.PrimaryKeyConstraint('id')

    )

    op.create_table(

        'networkqueuemappings',

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

        sa.Column('queue_id', sa.String(length=36), nullable=True),

        sa.ForeignKeyConstraint(['network_id'], ['networks.id'],

                                ondelete='CASCADE'),

        sa.ForeignKeyConstraint(['queue_id'], ['qosqueues.id'],

                                ondelete='CASCADE'),

        sa.PrimaryKeyConstraint('network_id')

    )

    op.create_table(

        'portqueuemappings',

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

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

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

        sa.ForeignKeyConstraint(['queue_id'], ['qosqueues.id'], ),

        sa.PrimaryKeyConstraint('port_id', 'queue_id')

    )

    ### end Alembic commands ###

**** 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('portqueuemappings')

    op.drop_table('networkqueuemappings')

    op.drop_table('qosqueues')

    ### end Alembic commands ###