]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove restriction of adding constraints to expand
authorKevin Benton <blak111@gmail.com>
Wed, 16 Sep 2015 20:08:57 +0000 (13:08 -0700)
committerKevin Benton <blak111@gmail.com>
Wed, 16 Sep 2015 20:26:10 +0000 (13:26 -0700)
Adding a constraint to a table shouldn't be restricted
to an expand operation. There can be contraction migrations
required before the constraint can be safely added (e.g. inserting
records into the target table of the constraint).

Change-Id: I1963facaa6ab1916d92c044f90b6c00291f00ab9

neutron/db/migration/__init__.py
neutron/tests/functional/db/test_migrations.py

index 8df941690d4586b5a4840b02769d4be54cf67cf8..5561e884d59b765daff15f82afdfde05d921c920 100644 (file)
@@ -22,8 +22,7 @@ import sqlalchemy as sa
 from sqlalchemy.engine import reflection
 
 
-CREATION_OPERATIONS = (sa.sql.ddl.AddConstraint,
-                       sa.sql.ddl.CreateIndex,
+CREATION_OPERATIONS = (sa.sql.ddl.CreateIndex,
                        sa.sql.ddl.CreateTable,
                        sa.sql.ddl.CreateColumn,
                        )
index ba9c09bcb76ed2d5c640e5514b360bccdc494860..678a45269bc03b3e297b98db5a0605f5851095d3 100644 (file)
@@ -270,9 +270,6 @@ class TestModelsMigrationsMysql(_TestModelsMigrations,
                         isinstance(element, sqlalchemy.Table) and
                         element.name in ['ml2_geneve_allocations',
                                          'ml2_geneve_endpoints'],
-                        isinstance(element, sqlalchemy.ForeignKeyConstraint)
-                        and
-                        element.table.name == 'flavorserviceprofilebindings',
                         isinstance(element, sqlalchemy.Index) and
                         element.table.name == 'ml2_geneve_allocations'
                     ]):