Merge "Use utf8_bin collation on the flavor extra-specs table in MySQL"

This commit is contained in:
Jenkins 2015-07-23 19:56:59 +00:00 committed by Gerrit Code Review
commit 4af10198b0
3 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,20 @@
# Copyright 2015 Cisco Systems, Inc.
#
# 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.
def upgrade(migrate_engine):
if migrate_engine.name == "mysql":
migrate_engine.execute("ALTER TABLE instance_type_extra_specs "
"CONVERT TO CHARACTER SET utf8 "
"COLLATE utf8_bin;")

View File

@ -1022,6 +1022,7 @@ class InstanceTypeExtraSpecs(BASE, NovaBase):
name=("uniq_instance_type_extra_specs0"
"instance_type_id0key0deleted")
),
{'mysql_collate': 'utf8_bin'},
)
id = Column(Integer, primary_key=True)
key = Column(String(255))

View File

@ -761,6 +761,11 @@ class NovaMigrationsCheckers(test_migrations.ModelsMigrationsSync,
def _check_297(self, engine, data):
self.assertColumnExists(engine, 'services', 'forced_down')
def _check_298(self, engine, data):
# NOTE(nic): This is a MySQL-specific migration, and is a no-op from
# the point-of-view of unit tests, since they use SQLite
pass
class TestNovaMigrationsSQLite(NovaMigrationsCheckers,
test_base.DbTestCase,