Fix metadef tags migrations
Adds new migration to fix an issue with an index created by mysql. Also includes patch I00da67ab06cd0a3c46aa8a6cd815d0559408c2f0, because without it tests won't pass. Change-Id: Iffb54d5ee404889d49c40dbe0401d61e55723872 Co-Authored-By: Mike Fedosin <mfedosin@mirantis.com> Co-Authored-By: Andreas Jaeger <aj@suse.de> Co-Authored-By: Oleksii Chuprykov <ochuprykov@mirantis.com>
This commit is contained in:
parent
232a8786dd
commit
401e35e152
@ -0,0 +1,24 @@
|
|||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
|
import sqlalchemy
|
||||||
|
from sqlalchemy import (Table, Index)
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade(migrate_engine):
|
||||||
|
if migrate_engine.name == 'mysql':
|
||||||
|
meta = sqlalchemy.MetaData()
|
||||||
|
meta.bind = migrate_engine
|
||||||
|
metadef_tags = Table('metadef_tags', meta, autoload=True)
|
||||||
|
Index('namespace_id', metadef_tags.c.namespace_id,
|
||||||
|
metadef_tags.c.name).drop()
|
@ -90,7 +90,8 @@ class MigrationsMixin(test_migrations.WalkVersionsMixin):
|
|||||||
return self.engine
|
return self.engine
|
||||||
|
|
||||||
def test_walk_versions(self):
|
def test_walk_versions(self):
|
||||||
self._walk_versions(True, False)
|
# No more downgrades
|
||||||
|
self._walk_versions(False, False)
|
||||||
|
|
||||||
def _create_unversioned_001_db(self, engine):
|
def _create_unversioned_001_db(self, engine):
|
||||||
# Create the initial version of the images table
|
# Create the initial version of the images table
|
||||||
@ -1485,6 +1486,15 @@ class MigrationsMixin(test_migrations.WalkVersionsMixin):
|
|||||||
self.assertTrue(unique_constraint_exist(
|
self.assertTrue(unique_constraint_exist(
|
||||||
'name', metadef_resource_types.name, engine))
|
'name', metadef_resource_types.name, engine))
|
||||||
|
|
||||||
|
def _check_040(self, engine, data):
|
||||||
|
meta = sqlalchemy.MetaData()
|
||||||
|
meta.bind = engine
|
||||||
|
metadef_tags = sqlalchemy.Table('metadef_tags', meta, autoload=True)
|
||||||
|
|
||||||
|
if engine.name == 'mysql':
|
||||||
|
self.assertFalse(index_exist('namespace_id',
|
||||||
|
metadef_tags.name, engine))
|
||||||
|
|
||||||
|
|
||||||
class TestMysqlMigrations(test_base.MySQLOpportunisticTestCase,
|
class TestMysqlMigrations(test_base.MySQLOpportunisticTestCase,
|
||||||
MigrationsMixin):
|
MigrationsMixin):
|
||||||
@ -1518,7 +1528,8 @@ class TestPostgresqlMigrations(test_base.PostgreSQLOpportunisticTestCase,
|
|||||||
class TestSqliteMigrations(test_base.DbTestCase,
|
class TestSqliteMigrations(test_base.DbTestCase,
|
||||||
MigrationsMixin):
|
MigrationsMixin):
|
||||||
def test_walk_versions(self):
|
def test_walk_versions(self):
|
||||||
self._walk_versions(True, True)
|
# No more downgrades
|
||||||
|
self._walk_versions(False, False)
|
||||||
|
|
||||||
|
|
||||||
class ModelsMigrationSyncMixin(object):
|
class ModelsMigrationSyncMixin(object):
|
||||||
|
@ -12,7 +12,7 @@ greenlet>=0.3.2
|
|||||||
# < 0.8.0/0.8 does not work, see https://bugs.launchpad.net/bugs/1153983
|
# < 0.8.0/0.8 does not work, see https://bugs.launchpad.net/bugs/1153983
|
||||||
SQLAlchemy>=0.9.7,<=0.9.99
|
SQLAlchemy>=0.9.7,<=0.9.99
|
||||||
anyjson>=0.3.3
|
anyjson>=0.3.3
|
||||||
eventlet>=0.16.1
|
eventlet>=0.16.1,!=0.17.0
|
||||||
PasteDeploy>=1.5.0
|
PasteDeploy>=1.5.0
|
||||||
Routes>=1.12.3,!=2.0
|
Routes>=1.12.3,!=2.0
|
||||||
WebOb>=1.2.3
|
WebOb>=1.2.3
|
||||||
@ -22,13 +22,13 @@ kombu>=2.5.0
|
|||||||
pycrypto>=2.6
|
pycrypto>=2.6
|
||||||
iso8601>=0.1.9
|
iso8601>=0.1.9
|
||||||
ordereddict
|
ordereddict
|
||||||
oslo.config>=1.9.0 # Apache-2.0
|
oslo.config>=1.9.3,<1.10.0 # Apache-2.0
|
||||||
oslo.concurrency>=1.4.1 # Apache-2.0
|
oslo.concurrency>=1.8.0,<1.9.0 # Apache-2.0
|
||||||
oslo.context>=0.2.0 # Apache-2.0
|
oslo.context>=0.2.0,<0.3.0 # Apache-2.0
|
||||||
oslo.utils>=1.2.0 # Apache-2.0
|
oslo.utils>=1.4.0,<1.5.0 # Apache-2.0
|
||||||
stevedore>=1.1.0 # Apache-2.0
|
stevedore>=1.3.0,<1.4.0 # Apache-2.0
|
||||||
taskflow>=0.6
|
taskflow>=0.7.1,<0.8.0
|
||||||
keystonemiddleware>=1.0.0
|
keystonemiddleware>=1.5.0
|
||||||
WSME>=0.6
|
WSME>=0.6
|
||||||
# For openstack/common/lockutils
|
# For openstack/common/lockutils
|
||||||
posix_ipc
|
posix_ipc
|
||||||
@ -37,7 +37,7 @@ posix_ipc
|
|||||||
python-swiftclient>=2.2.0
|
python-swiftclient>=2.2.0
|
||||||
|
|
||||||
# For VMware storage backed.
|
# For VMware storage backed.
|
||||||
oslo.vmware>=0.11.0 # Apache-2.0
|
oslo.vmware>=0.11.1,<0.12.0 # Apache-2.0
|
||||||
|
|
||||||
# For paste.util.template used in keystone.common.template
|
# For paste.util.template used in keystone.common.template
|
||||||
Paste
|
Paste
|
||||||
@ -49,12 +49,12 @@ semantic_version>=2.3.1
|
|||||||
# Required by openstack.common libraries
|
# Required by openstack.common libraries
|
||||||
six>=1.9.0
|
six>=1.9.0
|
||||||
|
|
||||||
oslo.db>=1.5.0 # Apache-2.0
|
oslo.db>=1.7.0,<1.8.0 # Apache-2.0
|
||||||
oslo.i18n>=1.3.0 # Apache-2.0
|
oslo.i18n>=1.5.0,<1.6.0 # Apache-2.0
|
||||||
oslo.log>=0.4.0 # Apache-2.0
|
oslo.log>=1.0.0,<1.1.0 # Apache-2.0
|
||||||
oslo.messaging>=1.6.0 # Apache-2.0
|
oslo.messaging>=1.8.0,<1.9.0 # Apache-2.0
|
||||||
oslo.policy~=0.3.1 # Apache-2.0
|
oslo.policy>=0.3.1,<0.4.0 # Apache-2.0
|
||||||
oslo.serialization>=1.2.0 # Apache-2.0
|
oslo.serialization>=1.4.0,<1.5.0 # Apache-2.0
|
||||||
|
|
||||||
retrying>=1.2.3,!=1.3.0 # Apache-2.0
|
retrying>=1.2.3,!=1.3.0 # Apache-2.0
|
||||||
osprofiler>=0.3.0 # Apache-2.0
|
osprofiler>=0.3.0 # Apache-2.0
|
||||||
|
@ -19,7 +19,7 @@ requests>=2.2.0,!=2.4.0
|
|||||||
testrepository>=0.0.18
|
testrepository>=0.0.18
|
||||||
testtools>=0.9.36,!=1.2.0
|
testtools>=0.9.36,!=1.2.0
|
||||||
psutil>=1.1.1,<2.0.0
|
psutil>=1.1.1,<2.0.0
|
||||||
oslotest>=1.2.0 # Apache-2.0
|
oslotest>=1.5.1,<1.6.0 # Apache-2.0
|
||||||
# Optional packages that should be installed when testing
|
# Optional packages that should be installed when testing
|
||||||
MySQL-python
|
MySQL-python
|
||||||
psycopg2
|
psycopg2
|
||||||
@ -28,4 +28,4 @@ qpid-python
|
|||||||
xattr>=0.4
|
xattr>=0.4
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
oslosphinx>=2.2.0 # Apache-2.0
|
oslosphinx>=2.5.0,<2.6.0 # Apache-2.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user