当前位置: 首页>>代码示例>>Python>>正文


Python migration.upgrade_enum函数代码示例

本文整理汇总了Python中nailgun.utils.migration.upgrade_enum函数的典型用法代码示例。如果您正苦于以下问题:Python upgrade_enum函数的具体用法?Python upgrade_enum怎么用?Python upgrade_enum使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了upgrade_enum函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: downgrade_release_state

def downgrade_release_state():
    connection = op.get_bind()

    connection.execute(sa.sql.text("UPDATE releases SET state='available' WHERE state!='unavailable'"))
    op.add_column("releases", sa.Column("is_deployable", sa.Boolean(), nullable=False, server_default="true"))

    upgrade_enum("releases", "state", "release_state", release_states_new, release_states_old)
开发者ID:gitfred,项目名称:fuel-web,代码行数:7,代码来源:fuel_8_0.py

示例2: restore_legacy_patching

def restore_legacy_patching():
    op.add_column(
        'releases',
        sa.Column(
            'can_update_from_versions',
            fields.JSON(),
            nullable=False,
            server_default='[]'
        ))
    op.add_column(
        'clusters',
        sa.Column(
            'pending_release_id',
            sa.Integer(),
            nullable=True
        ))
    op.create_foreign_key(
        'fk_pending_release_id',
        'clusters',
        'releases',
        ['pending_release_id'],
        ['id'])

    upgrade_enum(
        "clusters",                 # table
        "status",                   # column
        "cluster_status",           # ENUM name
        cluster_statuses_new,       # new options
        cluster_statuses_old,       # old options
    )
开发者ID:ekorekin,项目名称:fuel-web,代码行数:30,代码来源:fuel_9_0.py

示例3: downgrade_remove_vmware

def downgrade_remove_vmware():
    op.add_column(
        'releases',
        sa.Column('vmware_attributes_metadata', fields.JSON(), nullable=True))

    op.create_table(
        'vmware_attributes',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('cluster_id', sa.Integer()),
        sa.Column('editable', fields.JSON()),
        sa.ForeignKeyConstraint(['cluster_id'], ['clusters.id'], ),
        sa.PrimaryKeyConstraint('id'))

    upgrade_enum(
        "cluster_changes",          # table
        "name",                     # column
        "possible_changes",         # ENUM name
        cluster_changes_new,        # new options
        cluster_changes_old         # old options
    )

    op.drop_constraint(
        'vmware_attributes_cluster_id_fkey',
        'vmware_attributes',
        type_='foreignkey'
    )

    op.create_foreign_key(
        'vmware_attributes_cluster_id_fkey',
        'vmware_attributes', 'clusters',
        ['cluster_id'], ['id'],
        ondelete='CASCADE'
    )
开发者ID:openstack,项目名称:fuel-web,代码行数:33,代码来源:fuel_10_0.py

示例4: upgrade_release_state

def upgrade_release_state():
    connection = op.get_bind()
    op.drop_column("releases", "is_deployable")

    upgrade_enum("releases", "state", "release_state", release_states_old, release_states_new)

    connection.execute(sa.sql.text("UPDATE releases SET state='manageonly' WHERE state!='unavailable'"))
开发者ID:gitfred,项目名称:fuel-web,代码行数:7,代码来源:fuel_8_0.py

示例5: downgrade_bond_modes

def downgrade_bond_modes():
    upgrade_enum(
        'node_bond_interfaces',     # table
        'mode',                     # column
        'bond_mode',                # ENUM name
        bond_modes_new,             # old options
        bond_modes_old,             # new options
    )
开发者ID:ekorekin,项目名称:fuel-web,代码行数:8,代码来源:fuel_9_0.py

示例6: add_node_discover_error_downgrade

def add_node_discover_error_downgrade():
    upgrade_enum(
        "nodes",
        "error_type",
        "node_error_type",
        node_errors_new,
        node_errors_old
    )
开发者ID:gdyuldin,项目名称:fuel-web,代码行数:8,代码来源:fuel_8_0.py

示例7: task_names_downgrade

def task_names_downgrade():
    upgrade_enum(
        "tasks",
        "name",
        "task_name",
        task_names_new,
        task_names_old
    )
开发者ID:gdyuldin,项目名称:fuel-web,代码行数:8,代码来源:fuel_8_0.py

示例8: task_names_upgrade

def task_names_upgrade():
    upgrade_enum(
        "tasks",
        "name",
        "task_name",
        task_names_old,
        task_names_new
    )
开发者ID:gdyuldin,项目名称:fuel-web,代码行数:8,代码来源:fuel_8_0.py

示例9: downgrade_neutron_l23_providers

def downgrade_neutron_l23_providers():
    upgrade_enum(
        "neutron_config",           # table
        "net_l23_provider",         # column
        "net_l23_provider",         # ENUM name
        neutron_l23_providers_new,  # old options
        neutron_l23_providers_old   # new options
    )
开发者ID:ekorekin,项目名称:fuel-web,代码行数:8,代码来源:fuel_9_0.py

示例10: downgrade_node_status_attributes

def downgrade_node_status_attributes():
    upgrade_enum(
        "nodes",                    # table
        "status",                   # column
        "node_status",              # ENUM name
        node_statuses_new,          # old options
        node_statuses_old           # new options
    )
开发者ID:ekorekin,项目名称:fuel-web,代码行数:8,代码来源:fuel_9_0.py

示例11: downgrade_node_stop_deployment_error_type

def downgrade_node_stop_deployment_error_type():
    upgrade_enum(
        "nodes",
        "error_type",
        "node_error_type",
        node_errors_new,
        node_errors_old
    )
开发者ID:ekorekin,项目名称:fuel-web,代码行数:8,代码来源:fuel_9_0.py

示例12: downgrade_task_names

def downgrade_task_names():
    upgrade_enum(
        "tasks",                    # table
        "name",                     # column
        "task_name",                # ENUM name
        task_names_new,             # old options
        task_names_old              # new options
    )
开发者ID:linglong0820,项目名称:fuel-web,代码行数:8,代码来源:fuel_7_0.py

示例13: downgrade_transaction_names

def downgrade_transaction_names():
    upgrade_enum(
        'tasks',
        'name',
        'task_name',
        transaction_names_new,
        transaction_names_old
    )
开发者ID:huyupeng,项目名称:fuel-web,代码行数:8,代码来源:fuel_9_0_1.py

示例14: downgrade_transaction_names

def downgrade_transaction_names():
    migration.upgrade_enum(
        'tasks',
        'name',
        'task_name',
        TASK_NAMES_NEW,
        TASK_NAMES_OLD
    )
开发者ID:openstack,项目名称:fuel-web,代码行数:8,代码来源:fuel_9_2.py

示例15: downgrade_orchestrator_task_types

def downgrade_orchestrator_task_types():
    upgrade_enum(
        'deployment_graph_tasks',
        'type',
        'deployment_graph_tasks_type',
        orchestrator_task_types_new,
        orchestrator_task_types_old
    )
开发者ID:mmalchuk,项目名称:openstack-fuel-web,代码行数:8,代码来源:fuel_9_0_2.py


注:本文中的nailgun.utils.migration.upgrade_enum函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。