• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python migration.upgrade_enum函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: extend_segmentation_type_downgrade

def extend_segmentation_type_downgrade():

    segmentation_type_old = ('vlan', 'gre')
    segmentation_type_new = ('vlan', 'gre', 'tun')

    upgrade_enum('neutron_config',
                 'segmentation_type',
                 'segmentation_type',
                 segmentation_type_new,
                 segmentation_type_old)
开发者ID:linglong0820,项目名称:fuel-web,代码行数:10,代码来源:fuel_7_0.py


示例17: downgrade_schema

def downgrade_schema():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("nodes", "replaced_provisioning_info")
    op.drop_column("nodes", "replaced_deployment_info")
    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
    )

    upgrade_enum(
        "cluster_changes",  # table
        "name",  # column
        "possible_changes",  # ENUM name
        cluster_changes_new,  # new options
        cluster_changes_old,  # old options
    )
    upgrade_enum(
        "notifications",  # table
        "topic",  # column
        "notif_topic",  # ENUM name
        notification_topics_new,  # new options
        notification_topics_old,  # old options
    )
    upgrade_enum(
        "tasks",  # table
        "name",  # column
        "task_name",  # ENUM name
        task_names_new,  # old options
        task_names_old,  # new options
    )
    upgrade_enum(
        "clusters",  # table
        "status",  # column
        "cluster_status",  # ENUM name
        cluster_statuses_new,  # old options
        cluster_statuses_old,  # new options
    )

    op.drop_constraint("fk_pending_release_id", "clusters", type_="foreignkey")
    op.drop_column("clusters", "pending_release_id")
    op.drop_column("releases", "can_update_from_versions")
    op.create_table(
        "red_hat_accounts",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("username", sa.String(length=100), nullable=False),
        sa.Column("password", sa.String(length=100), nullable=False),
        sa.Column("license_type", sa.Enum("rhsm", "rhn", name="license_type"), nullable=False),
        sa.Column("satellite", sa.String(length=250), nullable=False),
        sa.Column("activation_key", sa.String(length=300), nullable=False),
        sa.PrimaryKeyConstraint("id"),
    )
开发者ID:koder-ua,项目名称:nailgun-fcert,代码行数:54,代码来源:fuel_5_1.py


示例18: drop_legacy_patching

def drop_legacy_patching():
    upgrade_enum(
        "clusters",                 # table
        "status",                   # column
        "cluster_status",           # ENUM name
        cluster_statuses_old,       # old options
        cluster_statuses_new,       # new options
    )

    op.drop_constraint(
        'fk_pending_release_id',
        'clusters',
        type_='foreignkey'
    )
    op.drop_column('clusters', 'pending_release_id')
    op.drop_column('releases', 'can_update_from_versions')
开发者ID:ekorekin,项目名称:fuel-web,代码行数:16,代码来源:fuel_9_0.py


示例19: downgrade

def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    upgrade_enum(
        "cluster_changes",          # table
        "name",                     # column
        "possible_changes",         # ENUM name
        cluster_changes_new,        # new options
        cluster_changes_old,        # old options
    )
    upgrade_enum(
        "notifications",            # table
        "topic",                    # column
        "notif_topic",              # ENUM name
        new_notification_topics,    # new options
        old_notification_topics,    # old options
    )
    upgrade_enum(
        "tasks",                    # table
        "name",                     # column
        "task_name",                # ENUM name
        task_names_new,             # old options
        task_names_old              # new options
    )
    upgrade_enum(
        "clusters",                 # table
        "status",                   # column
        "cluster_status",           # ENUM name
        cluster_statuses_new,       # old options
        cluster_statuses_old        # new options
    )

    op.drop_constraint(
        'fk_pending_release_id',
        'clusters',
        type_='foreignkey'
    )
    op.drop_column('clusters', 'pending_release_id')
    op.drop_column('releases', 'can_update_from_versions')
    op.create_table('red_hat_accounts',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('username',
                              sa.String(length=100),
                              nullable=False),
                    sa.Column('password',
                              sa.String(length=100),
                              nullable=False),
                    sa.Column('license_type', sa.Enum('rhsm', 'rhn',
                                                      name='license_type'),
                              nullable=False),
                    sa.Column('satellite',
                              sa.String(length=250),
                              nullable=False),
                    sa.Column('activation_key',
                              sa.String(length=300),
                              nullable=False),
                    sa.PrimaryKeyConstraint('id')
                    )
开发者ID:iberezovskiy,项目名称:fuel-web,代码行数:57,代码来源:fuel_5_1.py


示例20: upgrade

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        'releases',
        sa.Column(
            'can_update_from_versions',
            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_old,       # old options
        cluster_statuses_new        # new options
    )
    upgrade_enum(
        "tasks",                    # table
        "name",                     # column
        "task_name",                # ENUM name
        task_names_old,             # old options
        task_names_new              # new options
    )
    upgrade_enum(
        "notifications",            # table
        "topic",                    # column
        "notif_topic",              # ENUM name
        old_notification_topics,    # old options
        new_notification_topics,    # new options
    )
    upgrade_enum(
        "cluster_changes",          # table
        "name",                     # column
        "possible_changes",         # ENUM name
        cluster_changes_old,        # old options
        cluster_changes_new         # new options
    )

    op.drop_table('red_hat_accounts')
    drop_enum('license_type')
开发者ID:iberezovskiy,项目名称:fuel-web,代码行数:57,代码来源:fuel_5_1.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python manager.calc_glance_cache_size函数代码示例发布时间:2022-05-27
下一篇:
Python utils.traverse函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap