¡@

Home 

OpenStack Study: 2528ceb28230_nec_pf_netid_fix.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('packetfilters', 'network_id',

                    existing_type=sa.String(length=36),

                    nullable=False)

**** CubicPower OpenStack Study ****

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

    if not migration.should_run(active_plugins, migration_for_plugins):

        return

    # NOTE(amotoki): There is a bug that nullable of network_id is

    # set to True by mistake in folsom_initial (bug 1229508).

    # To make sure nullable=False in any revision, nullable is set

    # to False in both upgrade and downgrade.

    op.alter_column('packetfilters', 'network_id',

                    existing_type=sa.String(length=36),

                    nullable=False)