From: Kevin Benton Date: Wed, 16 Sep 2015 20:08:57 +0000 (-0700) Subject: Remove restriction of adding constraints to expand X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=d8a5e23e875643ee184fd1d8c04c5d586c80d313;p=openstack-build%2Fneutron-build.git Remove restriction of adding constraints to expand 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 --- diff --git a/neutron/db/migration/__init__.py b/neutron/db/migration/__init__.py index 8df941690..5561e884d 100644 --- a/neutron/db/migration/__init__.py +++ b/neutron/db/migration/__init__.py @@ -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, ) diff --git a/neutron/tests/functional/db/test_migrations.py b/neutron/tests/functional/db/test_migrations.py index ba9c09bcb..678a45269 100644 --- a/neutron/tests/functional/db/test_migrations.py +++ b/neutron/tests/functional/db/test_migrations.py @@ -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' ]):