¡@

Home 

OpenStack Study: 1341ed32cc1e_nvp_netbinding_update.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.alter_column('nvp_network_bindings', 'tz_uuid',

                    name='phy_uuid',

                    existing_type=sa.String(36),

                    existing_nullable=True)

    op.alter_column('nvp_network_bindings', 'binding_type',

                    type_=sa.Enum('flat', 'vlan', 'stt', 'gre', 'l3_ext',

                                  name='nvp_network_bindings_binding_type'),

                    existing_nullable=True)

**** CubicPower OpenStack Study ****

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

    if not migration.should_run(active_plugins, migration_for_plugins):

        return

    op.alter_column('nvp_network_bindings', 'phy_uuid',

                    name='tz_uuid',

                    existing_type=sa.String(36),

                    existing_nullable=True)

    op.alter_column('nvp_network_bindings', 'binding_type',

                    type_=sa.Enum('flat', 'vlan', 'stt', 'gre',

                                  name='nvp_network_bindings_binding_type'),

                    existing_nullable=True)