本文整理汇总了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)
示例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
)
示例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'
)
示例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'"))
示例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
)
示例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
)
示例7: task_names_downgrade
def task_names_downgrade():
upgrade_enum(
"tasks",
"name",
"task_name",
task_names_new,
task_names_old
)
示例8: task_names_upgrade
def task_names_upgrade():
upgrade_enum(
"tasks",
"name",
"task_name",
task_names_old,
task_names_new
)
示例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
)
示例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
)
示例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
)
示例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
)
示例13: downgrade_transaction_names
def downgrade_transaction_names():
upgrade_enum(
'tasks',
'name',
'task_name',
transaction_names_new,
transaction_names_old
)
示例14: downgrade_transaction_names
def downgrade_transaction_names():
migration.upgrade_enum(
'tasks',
'name',
'task_name',
TASK_NAMES_NEW,
TASK_NAMES_OLD
)
示例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
)