¡@

Home 

OpenStack Study: 1fcfc149aca4_agents_unique_by_type_and_host.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_unique_constraint(

        name=UC_NAME,

        source=TABLE_NAME,

        local_cols=['agent_type', 'host']

    )

**** CubicPower OpenStack Study ****

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

    if not migration.should_run(active_plugins, migration_for_plugins):

        return

    op.drop_constraint(

        name=UC_NAME,

        table_name=TABLE_NAME,

        type_='unique'

    )