]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Block downgrade from icehouse to havana
authorAnn Kamyshnikova <akamyshnikova@mirantis.com>
Wed, 20 Aug 2014 12:24:10 +0000 (16:24 +0400)
committerAnn Kamyshnikova <akamyshnikova@mirantis.com>
Thu, 28 Aug 2014 09:43:25 +0000 (09:43 +0000)
We are purging all downgrade methods from icehouse to havana because:
 1) havana is going to become unsupported during Kilo cycle.
 2) most people will upgrade from icehouse, while a minor percentage
    from havana
 3) downgrade use cases are mostly to revert after failed upgrades

See discussion in https://review.openstack.org/109952 for details.

This change removes all downgrade code in this migrations and raises
an exception in downgrade of icehouse_release.

Partially-implements: blueprint reorganize-migrations

Change-Id: I874dd2475da0404370dc7e53d7c43e0a8dce0d56

28 files changed:
neutron/db/migration/alembic_migrations/versions/117643811bca_nec_delete_ofc_mapping.py
neutron/db/migration/alembic_migrations/versions/1421183d533f_nsx_dhcp_metadata.py
neutron/db/migration/alembic_migrations/versions/157a5d299379_ml2_binding_profile.py
neutron/db/migration/alembic_migrations/versions/19180cf98af6_nsx_gw_devices.py
neutron/db/migration/alembic_migrations/versions/1b2580001654_nsx_sec_group_mappin.py
neutron/db/migration/alembic_migrations/versions/1fcfc149aca4_agents_unique_by_type_and_host.py
neutron/db/migration/alembic_migrations/versions/2447ad0e9585_add_ipv6_mode_props.py
neutron/db/migration/alembic_migrations/versions/24c7ea5160d7_cisco_csr_vpnaas.py
neutron/db/migration/alembic_migrations/versions/27cc183af192_ml2_vnic_type.py
neutron/db/migration/alembic_migrations/versions/2eeaf963a447_floatingip_status.py
neutron/db/migration/alembic_migrations/versions/33dd0a9fa487_embrane_lbaas_driver.py
neutron/db/migration/alembic_migrations/versions/3d2585038b95_vmware_nsx.py
neutron/db/migration/alembic_migrations/versions/3d3cb89d84ee_nsx_switch_mappings.py
neutron/db/migration/alembic_migrations/versions/492a106273f8_brocade_ml2_mech_dri.py
neutron/db/migration/alembic_migrations/versions/4ca36cfc898c_nsx_router_mappings.py
neutron/db/migration/alembic_migrations/versions/50d5ba354c23_ml2_binding_vif_details.py
neutron/db/migration/alembic_migrations/versions/50e86cb2637a_nsx_mappings.py
neutron/db/migration/alembic_migrations/versions/538732fa21e1_nec_rename_quantum_id_to_neutron_id.py
neutron/db/migration/alembic_migrations/versions/5ac1c354a051_n1kv_segment_alloc.py
neutron/db/migration/alembic_migrations/versions/81c553f3776c_bsn_consistencyhashes.py
neutron/db/migration/alembic_migrations/versions/8f682276ee4_ryu_plugin_quota.py
neutron/db/migration/alembic_migrations/versions/abc88c33f74f_lb_stats_needs_bigint.py
neutron/db/migration/alembic_migrations/versions/e197124d4b9_add_unique_constrain.py
neutron/db/migration/alembic_migrations/versions/e766b19a3bb_nuage_initial.py
neutron/db/migration/alembic_migrations/versions/ed93525fd003_bigswitch_quota.py
neutron/db/migration/alembic_migrations/versions/f44ab9871cd6_bsn_security_groups.py
neutron/db/migration/alembic_migrations/versions/fcac4c42e2cc_bsn_addresspairs.py
neutron/db/migration/alembic_migrations/versions/icehouse_release.py

index 8db9434925fad844b0930f3dc7745ddfa9f9d757..9c49d47716c4d289e67b024adb6de4f02d4141c6 100644 (file)
@@ -179,30 +179,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.create_table(
-        'ofctenants',
-        sa.Column('id', sa.String(length=36), nullable=False),
-        sa.Column('quantum_id', sa.String(length=36), nullable=False),
-        sa.PrimaryKeyConstraint('id')
-    )
-    op.create_table(
-        'ofcnetworks',
-        sa.Column('id', sa.String(length=36), nullable=False),
-        sa.Column('quantum_id', sa.String(length=36), nullable=False),
-        sa.PrimaryKeyConstraint('id')
-    )
-    op.create_table(
-        'ofcports',
-        sa.Column('id', sa.String(length=36), nullable=False),
-        sa.Column('quantum_id', sa.String(length=36), nullable=False),
-        sa.PrimaryKeyConstraint('id')
-    )
-    op.create_table(
-        'ofcfilters',
-        sa.Column('id', sa.String(length=36), nullable=False),
-        sa.Column('quantum_id', sa.String(length=36), nullable=False),
-        sa.PrimaryKeyConstraint('id')
-    )
+    pass
index 69e5414a8f3b42aa6cbd76f1aa4b05459eeb16fe..2bde94c552348a45a5eb840da9c85f133b936d0b 100644 (file)
@@ -67,8 +67,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_table('lsn_port')
-    op.drop_table('lsn')
+    pass
index f7900b69906f68e6b0d2395fb92fa432443cfe8f..b89b4e92480825cba98b80e7cfd58852b061b345 100644 (file)
@@ -47,7 +47,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_column('ml2_port_bindings', 'profile')
+    pass
index c5972444ee0ba42afabf673e8895899a5186def8..6ab788de8ab8c8927949c4dea1def9cce0399ea7 100644 (file)
@@ -79,22 +79,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_table('networkgatewaydevices')
-    # Re-create previous version of networkgatewaydevices table
-    op.create_table(
-        'networkgatewaydevices',
-        sa.Column('id', sa.String(length=36), nullable=False),
-        sa.Column('network_gateway_id', sa.String(length=36), nullable=True),
-        sa.Column('interface_name', sa.String(length=64), nullable=True),
-        sa.ForeignKeyConstraint(['network_gateway_id'], ['networkgateways.id'],
-                                ondelete='CASCADE'),
-        sa.PrimaryKeyConstraint('id'))
-    # Copy from networkgatewaydevicereferences to networkgatewaydevices
-    op.execute("INSERT INTO networkgatewaydevices SELECT "
-               "id, network_gateway_id, interface_name FROM "
-               "networkgatewaydevicereferences")
-    # Dropt networkgatewaydevicereferences
-    op.drop_table('networkgatewaydevicereferences')
+    pass
index 76e072ca3b7b9052b9f0ef1b10b1dc60a42ce449..9ad216d4a7f8bcd04cc6bb0156a50e33b32479e5 100644 (file)
@@ -56,6 +56,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-    op.drop_table('neutron_nsx_security_group_mappings')
+    pass
index f3ac0980a3da541ce8a4bcd4a6d69c1f027d64ed..d1339853ef472dff46e32a5293eb209d557bcd8f 100644 (file)
@@ -62,11 +62,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_constraint(
-        name=UC_NAME,
-        table_name=TABLE_NAME,
-        type_='unique'
-    )
+    pass
\ No newline at end of file
index f3b444a22e5a2897ef4797eb44b18c6eac24e883..dc0e7f5a41966d113febed6c563efe0350d63c09 100644 (file)
@@ -70,12 +70,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_column('subnets', 'ipv6_ra_mode')
-    op.drop_column('subnets', 'ipv6_address_mode')
-    context = op.get_context()
-    if context.bind.dialect.name == 'postgresql':
-        op.execute('DROP TYPE ipv6_ra_modes')
-        op.execute('DROP TYPE ipv6_address_modes')
+    pass
index f7cdfd9137dc54e949222af4334e8182ea4871da..38b5b2efd90afa6431a60008f751a8eae25a6a61 100644 (file)
@@ -54,7 +54,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_table('cisco_csr_identifier_map')
+    pass
index db38e65a23b920c214704af7aaca39f17fb40d3a..c2a368ccc38faa5c4cad02be8e15b1f41f9424a6 100644 (file)
@@ -48,7 +48,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_column('ml2_port_bindings', 'vnic_type')
+    pass
index 7da8f8415954767d3f40a7d97f0a9a92c8d6c27c..156b6b8a3eea89260d9a6ff23403cbe17f3e2392 100644 (file)
@@ -73,7 +73,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-    op.drop_column('floatingips', 'last_known_router_id')
-    op.drop_column('floatingips', 'status')
+    pass
\ No newline at end of file
index f1d5fd016160e72e2c73b888deb23d4dd724b8ba..e58a07f4137486fe9956dd6409bd90e160e76750 100644 (file)
@@ -53,7 +53,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_table(u'embrane_pool_port')
+    pass
index c51f02a3db6ee01e1096733d7bdba4b1435de003..3fd3311985c22a907642b3cd24ecfe4be7a94bfc 100644 (file)
@@ -53,13 +53,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    engine = op.get_bind().engine
-    if engine.name == 'postgresql':
-        op.execute("ALTER TYPE tz_network_bindings_binding_type "
-                   "RENAME TO nvp_network_bindings_binding_type;")
-
-    op.rename_table('multi_provider_networks', 'nvp_multi_provider_networks')
-    op.rename_table('tz_network_bindings', 'nvp_network_bindings')
+    pass
index 2b4da489147b7eb6f0a78fd2eeb9879ad6c9c52e..cc3b529f4ef7999d7f029bfd6e9d5442e0f295f8 100644 (file)
@@ -55,7 +55,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_table('neutron_nsx_network_mappings')
+    pass
\ No newline at end of file
index 65cde2e80dc36facc499923e1910e197ddecb8f9..94112b88a8204ef3c9baf5b4d6ea38f2a867ff59 100644 (file)
@@ -63,8 +63,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_table('ml2_brocadeports')
-    op.drop_table('ml2_brocadenetworks')
+    pass
index c9784a8905701acb9d7a88d812872b586dece016..1e9e9d74dc23a3fa0215c5f2fe4be47395a08e81 100644 (file)
@@ -58,7 +58,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_table('neutron_nsx_router_mappings')
+    pass
index ad4fa3b91e8a098ca9650f5b52077eb8afd8aa1b..1f89cf32ac70bfb33511cdacff6f935b187c7bd3 100644 (file)
@@ -68,30 +68,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    if op.get_bind().engine.name == 'ibm_db_sa':
-        # Note(xuhanp): DB2 doesn't allow nullable=False Column with
-        # "DEFAULT" clause not specified. So server_default is used.
-        # Using sa.text will result "DEFAULT 0" for cap_port_filter.
-        op.add_column('ml2_port_bindings',
-                      sa.Column('cap_port_filter', sa.Boolean(),
-                                nullable=False,
-                                server_default=sa.text("0")))
-        op.execute(
-            "UPDATE ml2_port_bindings SET"
-            " cap_port_filter = 1"
-            " WHERE vif_details LIKE '%\"port_filter\": true%'")
-    else:
-        op.add_column('ml2_port_bindings',
-                      sa.Column('cap_port_filter', sa.Boolean(),
-                                nullable=False,
-                                server_default=sa.text("false")))
-        op.execute(
-            "UPDATE ml2_port_bindings SET"
-            " cap_port_filter = true"
-            " WHERE vif_details LIKE '%\"port_filter\": true%'")
-    op.drop_column('ml2_port_bindings', 'vif_details')
-    if op.get_bind().engine.name == 'ibm_db_sa':
-        op.execute("CALL SYSPROC.ADMIN_CMD('REORG TABLE ml2_port_bindings')")
+    pass
index 80da209a0e5b37f9334d7aac0af3877d38eb4815..024d38edee0e07563f74f77066bbe13b4e420fc1 100644 (file)
@@ -62,19 +62,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    # Restore table to pre-icehouse version
-    op.create_table('quantum_nvp_port_mapping',
-                    sa.Column('quantum_id', sa.String(length=36),
-                              nullable=False),
-                    sa.Column('nvp_id', sa.String(length=36),
-                              nullable=False),
-                    sa.ForeignKeyConstraint(['quantum_id'], ['ports.id'],
-                                            ondelete='CASCADE'),
-                    sa.PrimaryKeyConstraint('quantum_id'))
-    op.execute("INSERT INTO quantum_nvp_port_mapping SELECT neutron_id as "
-               "quantum_id, nsx_port_id as nvp_id from"
-               " neutron_nsx_port_mappings")
-    op.drop_table('neutron_nsx_port_mappings')
+    pass
\ No newline at end of file
index 0dd6ca1490a6ef6ffd9339c842d17f2ca83a7d9d..ad3a347892a57e2fdf8f0a862ec0f0aaf6d0db25 100644 (file)
@@ -52,14 +52,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    for table in ['ofctenantmappings', 'ofcnetworkmappings',
-                  'ofcportmappings', 'ofcfiltermappings',
-                  'ofcroutermappings',
-                  ]:
-        op.alter_column(table, 'neutron_id',
-                        new_column_name='quantum_id',
-                        existing_type=sa.String(length=36),
-                        existing_nullable=False)
+    pass
index 516faaf78a8d9d9d4efc3dfb36f8dfc0d1bda4ea..09af7f8335e35a1b821c8c4db583c433fe8f5b75 100644 (file)
@@ -70,14 +70,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_constraint('cisco_n1kv_vxlan_allocations_ibfk_1',
-                       'cisco_n1kv_vxlan_allocations',
-                       'foreignkey')
-    op.drop_column('cisco_n1kv_vxlan_allocations', 'network_profile_id')
-    op.drop_constraint('cisco_n1kv_vlan_allocations_ibfk_1',
-                       'cisco_n1kv_vlan_allocations',
-                       'foreignkey')
-    op.drop_column('cisco_n1kv_vlan_allocations', 'network_profile_id')
+    pass
\ No newline at end of file
index 0300c247548f7159462487d376a8be7b8e973cd5..f24c57bd3103245caca4de09ecb281dfe83e51f8 100644 (file)
@@ -50,7 +50,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_table('consistencyhashes')
+    pass
index 72a06887f33616eaa472ee0461c1c570e987a323..e9cb78ba6acc2bc324180969f00109353e452b40 100644 (file)
@@ -53,7 +53,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_table('quotas')
+    pass
index b276ae7fc6f7a19bdfd2923bea706e8584200138..7d8e280b1278a5d65caa136837e8a1a1e256a1c4 100644 (file)
@@ -52,14 +52,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.alter_column('poolstatisticss', 'bytes_in',
-                    type_=sa.Integer(), existing_type=sa.BigInteger())
-    op.alter_column('poolstatisticss', 'bytes_out',
-                    type_=sa.Integer(), existing_type=sa.BigInteger())
-    op.alter_column('poolstatisticss', 'active_connections',
-                    type_=sa.Integer(), existing_type=sa.BigInteger())
-    op.alter_column('poolstatisticss', 'total_connections',
-                    type_=sa.Integer(), existing_type=sa.BigInteger())
+    pass
index cfc86a5541fd2807c5cd5987b0903907605869ea..b52cbd73fd0c2e17921d6d286b8c88ea12de2984 100644 (file)
@@ -53,11 +53,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_constraint(
-        CONSTRAINT_NAME,
-        TABLE_NAME,
-        type_='unique'
-    )
+    pass
\ No newline at end of file
index 3562c7d943f726cda7dc8faf892f47fc03d3e5af..5d79effc6aa4e9cd70fb541a58c73dbbf2cb5c4d 100644 (file)
@@ -107,14 +107,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_table('router_zone_mapping')
-    op.drop_table('net_partition_router_mapping')
-    op.drop_table('subnet_l2dom_mapping')
-    op.drop_table('port_mapping')
-    op.drop_table('net_partitions')
-    op.drop_table('quotas')
-
-    common_ext_ops.downgrade_l3()
+    pass
\ No newline at end of file
index f8980c6c6c94257cd2b3aa7721fa8516cbb4d262..674dec78abb4229ff1231537a33c9d552071dcc6 100644 (file)
@@ -54,9 +54,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    ### commands auto generated by Alembic - please adjust! ###
-    op.drop_table('quotas')
-    ### end Alembic commands ###
+    pass
\ No newline at end of file
index bdf7f36fb6e0d21a3ca8097ff808f771179c455a..a6a6ce4ddc5539f1f05426f977a38d46fa116aa2 100644 (file)
@@ -83,12 +83,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    ### commands auto generated by Alembic - please adjust! ###
-    op.drop_table('securitygroupportbindings')
-    op.drop_table('securitygrouprules')
-    securitygrouprules_direction.drop(op.get_bind(), checkfirst=False)
-    op.drop_table('securitygroups')
-    ### end Alembic commands ###
+    pass
index 9d80be9fbeab2f4e274d083ec8adf8e9e5a76ade..8a8e05fbf9e01164007767792cb79b145fc83d29 100644 (file)
@@ -52,7 +52,4 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    if not migration.should_run(active_plugins, migration_for_plugins):
-        return
-
-    op.drop_table('allowedaddresspairs')
+    pass
\ No newline at end of file
index 5a02ba699d5257784679e1ee1f5b9289ddc2beec..5b41d8df28ca410e2be27ab02e3786a11119e402 100644 (file)
@@ -36,5 +36,12 @@ def upgrade(active_plugins=None, options=None):
 
 
 def downgrade(active_plugins=None, options=None):
-    """A no-op migration for marking the Icehouse release."""
-    pass
+    # We are purging all downgrade methods from icehouse to havana because:
+    # 1) havana is going to become unsupported during Kilo cycle.
+    # 2) most people will upgrade from icehouse, while a minor percentage
+    #    from havana
+    # 3) downgrade use cases are mostly to revert after failed upgrades
+    # See discussion in https://review.openstack.org/109952 for details
+
+    raise NotImplementedError("Downgrade from icehouse to havana not "
+                              "supported")
\ No newline at end of file