From d8a5e23e875643ee184fd1d8c04c5d586c80d313 Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Wed, 16 Sep 2015 13:08:57 -0700 Subject: [PATCH] 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 --- neutron/db/migration/__init__.py | 3 +-- neutron/tests/functional/db/test_migrations.py | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) 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' ]): -- 2.45.2