diff --git a/neutron_vpnaas/db/migration/alembic_migrations/versions/newton/expand/fe637dc3f042_support_sha256.py b/neutron_vpnaas/db/migration/alembic_migrations/versions/newton/expand/fe637dc3f042_support_sha256.py index 0c3f9230f..df78b6a67 100644 --- a/neutron_vpnaas/db/migration/alembic_migrations/versions/newton/expand/fe637dc3f042_support_sha256.py +++ b/neutron_vpnaas/db/migration/alembic_migrations/versions/newton/expand/fe637dc3f042_support_sha256.py @@ -21,7 +21,7 @@ Create Date: 2016-04-08 22:33:53.286083 """ -from neutron.db import migration +from alembic import op import sqlalchemy as sa @@ -33,7 +33,7 @@ new_auth = sa.Enum('sha1', 'sha256', name='vpn_auth_algorithms') def upgrade(): - migration.alter_enum('ikepolicies', 'auth_algorithm', new_auth, - nullable=False, do_drop=False) - migration.alter_enum('ipsecpolicies', 'auth_algorithm', new_auth, - nullable=False, do_rename=False, do_create=False) + op.alter_column('ikepolicies', 'auth_algorithm', type_=new_auth, + nullable=False, do_drop=False) + op.alter_column('ipsecpolicies', 'auth_algorithm', type_=new_auth, + nullable=False, do_rename=False, do_create=False) diff --git a/neutron_vpnaas/db/migration/alembic_migrations/versions/ocata/expand/38893903cbde_add_auth_algorithm_sha384_and_sha512.py b/neutron_vpnaas/db/migration/alembic_migrations/versions/ocata/expand/38893903cbde_add_auth_algorithm_sha384_and_sha512.py index 6aeafd06a..c2317fe10 100644 --- a/neutron_vpnaas/db/migration/alembic_migrations/versions/ocata/expand/38893903cbde_add_auth_algorithm_sha384_and_sha512.py +++ b/neutron_vpnaas/db/migration/alembic_migrations/versions/ocata/expand/38893903cbde_add_auth_algorithm_sha384_and_sha512.py @@ -21,6 +21,7 @@ Create Date: 2016-11-04 18:00:49.219140 """ +from alembic import op from neutron.db import migration import sqlalchemy as sa @@ -37,7 +38,7 @@ new_auth = sa.Enum('sha1', 'sha256', 'sha384', 'sha512', def upgrade(): - migration.alter_enum('ikepolicies', 'auth_algorithm', new_auth, - nullable=False, do_drop=False) - migration.alter_enum('ipsecpolicies', 'auth_algorithm', new_auth, - nullable=False, do_rename=False, do_create=False) + op.alter_column('ikepolicies', 'auth_algorithm', type_=new_auth, + nullable=False, do_drop=False) + op.alter_column('ipsecpolicies', 'auth_algorithm', type_=new_auth, + nullable=False, do_rename=False, do_create=False) diff --git a/neutron_vpnaas/tests/functional/common/test_migrations_sync.py b/neutron_vpnaas/tests/functional/common/test_migrations_sync.py index 09c31a921..e743b9be6 100644 --- a/neutron_vpnaas/tests/functional/common/test_migrations_sync.py +++ b/neutron_vpnaas/tests/functional/common/test_migrations_sync.py @@ -25,7 +25,9 @@ EXTERNAL_TABLES = set(external.TABLES) - set(external.VPNAAS_TABLES) VERSION_TABLE = 'alembic_version_vpnaas' -class _TestModelsMigrationsVPNAAS(test_migrations._TestModelsMigrations): +class TestModelsMigrationsVPNAAS(test_migrations.TestModelsMigrations, + testlib_api.MySQLTestCaseMixin, + testlib_api.SqlTestCaseLight): def db_sync(self, engine): cfg.CONF.set_override( @@ -48,15 +50,3 @@ class _TestModelsMigrationsVPNAAS(test_migrations._TestModelsMigrations): if type_ == 'index' and reflected and name.startswith("idx_autoinc_"): return False return True - - -class TestModelsMigrationsMysql(testlib_api.MySQLTestCaseMixin, - _TestModelsMigrationsVPNAAS, - testlib_api.SqlTestCaseLight): - pass - - -class TestModelsMigrationsPostgresql(testlib_api.PostgreSQLTestCaseMixin, - _TestModelsMigrationsVPNAAS, - testlib_api.SqlTestCaseLight): - pass