From: Xu Han Peng Date: Fri, 6 Mar 2015 10:30:30 +0000 (+0800) Subject: Fix DB2 upgrade problem for Remove Hyper-V plugin X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=b8341239df2190bc33d20837e4a08cc6bc471c0b;p=openstack-build%2Fneutron-build.git Fix DB2 upgrade problem for Remove Hyper-V plugin The recently added upgrade script to remove hyperv neutron plugin breaks upgrade on DB2. This fix solves this problme by using "1" instead of "true" in sql when db2 is engine. Change-Id: I1afdf66c25dbea46588ee7b205fa6394b08c1de8 Closes-Bug: 1429058 --- diff --git a/neutron/db/migration/alembic_migrations/versions/2b801560a332_remove_hypervneutronplugin_tables.py b/neutron/db/migration/alembic_migrations/versions/2b801560a332_remove_hypervneutronplugin_tables.py index ec92ce957..aa6c46ef7 100644 --- a/neutron/db/migration/alembic_migrations/versions/2b801560a332_remove_hypervneutronplugin_tables.py +++ b/neutron/db/migration/alembic_migrations/versions/2b801560a332_remove_hypervneutronplugin_tables.py @@ -66,10 +66,16 @@ def _migrate_segment_dict(binding): def _migrate_vlan_allocations(): # Code similar to migrate_to_ml2.BaseMigrateToMl2.migrate_vlan_allocations - op.execute('INSERT INTO ml2_vlan_allocations ' - 'SELECT physical_network, vlan_id, allocated ' - 'FROM hyperv_vlan_allocations ' - 'WHERE allocated = TRUE') + if op.get_bind().engine.name == 'ibm_db_sa': + op.execute('INSERT INTO ml2_vlan_allocations ' + 'SELECT physical_network, vlan_id, allocated ' + 'FROM hyperv_vlan_allocations ' + 'WHERE allocated = 1') + else: + op.execute('INSERT INTO ml2_vlan_allocations ' + 'SELECT physical_network, vlan_id, allocated ' + 'FROM hyperv_vlan_allocations ' + 'WHERE allocated = TRUE') def _migrate_network_segments(engine):