Make utf8 the default charset for mysql
Newer versions of oslo_db added a sanity check to ensure that table's charsets are utf8. This patch makes this change explicit and re-enables the sanity check that was disabled in Ifffbdd50c38a1d25215faa6a966c2d2a63935711 Change-Id: Icbc41bd3964a6124d3e0d906cb85944fdc312844 Closes-bug: #1411489
This commit is contained in:
parent
1c8cd0e86c
commit
647d2895a7
@ -62,5 +62,4 @@ def db_sync(version=None, init_version=0, engine=None):
|
|||||||
return get_backend().db_sync(engine=engine,
|
return get_backend().db_sync(engine=engine,
|
||||||
abs_path=MIGRATE_REPO_PATH,
|
abs_path=MIGRATE_REPO_PATH,
|
||||||
version=version,
|
version=version,
|
||||||
init_version=init_version,
|
init_version=init_version)
|
||||||
sanity_check=False)
|
|
||||||
|
@ -67,7 +67,7 @@ class JSONEncodedDict(TypeDecorator):
|
|||||||
class GlanceBase(models.ModelBase, models.TimestampMixin):
|
class GlanceBase(models.ModelBase, models.TimestampMixin):
|
||||||
"""Base class for Glance Models."""
|
"""Base class for Glance Models."""
|
||||||
|
|
||||||
__table_args__ = {'mysql_engine': 'InnoDB'}
|
__table_args__ = {'mysql_engine': 'InnoDB', 'mysql_charset': 'utf8'}
|
||||||
__table_initialized__ = False
|
__table_initialized__ = False
|
||||||
__protected_attributes__ = set([
|
__protected_attributes__ = set([
|
||||||
"created_at", "updated_at", "deleted_at", "deleted"])
|
"created_at", "updated_at", "deleted_at", "deleted"])
|
||||||
|
@ -44,7 +44,7 @@ _LW = i18n._LW
|
|||||||
class ArtifactBase(models.ModelBase, models.TimestampMixin):
|
class ArtifactBase(models.ModelBase, models.TimestampMixin):
|
||||||
"""Base class for Artifact Models."""
|
"""Base class for Artifact Models."""
|
||||||
|
|
||||||
__table_args__ = {'mysql_engine': 'InnoDB'}
|
__table_args__ = {'mysql_engine': 'InnoDB', 'mysql_charset': 'utf8'}
|
||||||
__table_initialized__ = False
|
__table_initialized__ = False
|
||||||
__protected_attributes__ = set([
|
__protected_attributes__ = set([
|
||||||
"created_at", "updated_at"])
|
"created_at", "updated_at"])
|
||||||
@ -102,7 +102,7 @@ class Artifact(BASE, ArtifactBase):
|
|||||||
Index('ix_artifact_state', 'state'),
|
Index('ix_artifact_state', 'state'),
|
||||||
Index('ix_artifact_owner', 'owner'),
|
Index('ix_artifact_owner', 'owner'),
|
||||||
Index('ix_artifact_visibility', 'visibility'),
|
Index('ix_artifact_visibility', 'visibility'),
|
||||||
{'mysql_engine': 'InnoDB'})
|
{'mysql_engine': 'InnoDB', 'mysql_charset': 'utf8'})
|
||||||
|
|
||||||
__protected_attributes__ = ArtifactBase.__protected_attributes__.union(
|
__protected_attributes__ = ArtifactBase.__protected_attributes__.union(
|
||||||
set(['published_at', 'deleted_at']))
|
set(['published_at', 'deleted_at']))
|
||||||
@ -219,7 +219,7 @@ class ArtifactDependency(BASE, ArtifactBase):
|
|||||||
'artifact_dest'),
|
'artifact_dest'),
|
||||||
Index('ix_artifact_dependencies_direct_dependencies',
|
Index('ix_artifact_dependencies_direct_dependencies',
|
||||||
'artifact_source', 'is_direct'),
|
'artifact_source', 'is_direct'),
|
||||||
{'mysql_engine': 'InnoDB'})
|
{'mysql_engine': 'InnoDB', 'mysql_charset': 'utf8'})
|
||||||
|
|
||||||
id = Column(String(36), primary_key=True, nullable=False,
|
id = Column(String(36), primary_key=True, nullable=False,
|
||||||
default=lambda: str(uuid.uuid4()))
|
default=lambda: str(uuid.uuid4()))
|
||||||
@ -248,7 +248,7 @@ class ArtifactTag(BASE, ArtifactBase):
|
|||||||
__table_args__ = (Index('ix_artifact_tags_artifact_id', 'artifact_id'),
|
__table_args__ = (Index('ix_artifact_tags_artifact_id', 'artifact_id'),
|
||||||
Index('ix_artifact_tags_artifact_id_tag_value',
|
Index('ix_artifact_tags_artifact_id_tag_value',
|
||||||
'artifact_id', 'value'),
|
'artifact_id', 'value'),
|
||||||
{'mysql_engine': 'InnoDB'},)
|
{'mysql_engine': 'InnoDB', 'mysql_charset': 'utf8'},)
|
||||||
|
|
||||||
id = Column(String(36), primary_key=True, nullable=False,
|
id = Column(String(36), primary_key=True, nullable=False,
|
||||||
default=lambda: str(uuid.uuid4()))
|
default=lambda: str(uuid.uuid4()))
|
||||||
@ -265,7 +265,7 @@ class ArtifactProperty(BASE, ArtifactBase):
|
|||||||
__table_args__ = (
|
__table_args__ = (
|
||||||
Index('ix_artifact_properties_artifact_id', 'artifact_id'),
|
Index('ix_artifact_properties_artifact_id', 'artifact_id'),
|
||||||
Index('ix_artifact_properties_name', 'name'),
|
Index('ix_artifact_properties_name', 'name'),
|
||||||
{'mysql_engine': 'InnoDB'},)
|
{'mysql_engine': 'InnoDB', 'mysql_charset': 'utf8'},)
|
||||||
id = Column(String(36), primary_key=True, nullable=False,
|
id = Column(String(36), primary_key=True, nullable=False,
|
||||||
default=lambda: str(uuid.uuid4()))
|
default=lambda: str(uuid.uuid4()))
|
||||||
artifact_id = Column(String(36), ForeignKey('artifacts.id'),
|
artifact_id = Column(String(36), ForeignKey('artifacts.id'),
|
||||||
@ -287,7 +287,7 @@ class ArtifactBlob(BASE, ArtifactBase):
|
|||||||
__table_args__ = (
|
__table_args__ = (
|
||||||
Index('ix_artifact_blobs_artifact_id', 'artifact_id'),
|
Index('ix_artifact_blobs_artifact_id', 'artifact_id'),
|
||||||
Index('ix_artifact_blobs_name', 'name'),
|
Index('ix_artifact_blobs_name', 'name'),
|
||||||
{'mysql_engine': 'InnoDB'},)
|
{'mysql_engine': 'InnoDB', 'mysql_charset': 'utf8'},)
|
||||||
id = Column(String(36), primary_key=True, nullable=False,
|
id = Column(String(36), primary_key=True, nullable=False,
|
||||||
default=lambda: str(uuid.uuid4()))
|
default=lambda: str(uuid.uuid4()))
|
||||||
artifact_id = Column(String(36), ForeignKey('artifacts.id'),
|
artifact_id = Column(String(36), ForeignKey('artifacts.id'),
|
||||||
@ -306,7 +306,7 @@ class ArtifactBlobLocation(BASE, ArtifactBase):
|
|||||||
__tablename__ = 'artifact_blob_locations'
|
__tablename__ = 'artifact_blob_locations'
|
||||||
__table_args__ = (Index('ix_artifact_blob_locations_blob_id',
|
__table_args__ = (Index('ix_artifact_blob_locations_blob_id',
|
||||||
'blob_id'),
|
'blob_id'),
|
||||||
{'mysql_engine': 'InnoDB'})
|
{'mysql_engine': 'InnoDB', 'mysql_charset': 'utf8'})
|
||||||
|
|
||||||
id = Column(String(36), primary_key=True, nullable=False,
|
id = Column(String(36), primary_key=True, nullable=False,
|
||||||
default=lambda: str(uuid.uuid4()))
|
default=lambda: str(uuid.uuid4()))
|
||||||
|
@ -48,7 +48,7 @@ BASE_DICT = declarative_base(cls=DictionaryBase)
|
|||||||
class GlanceMetadefBase(models.TimestampMixin):
|
class GlanceMetadefBase(models.TimestampMixin):
|
||||||
"""Base class for Glance Metadef Models."""
|
"""Base class for Glance Metadef Models."""
|
||||||
|
|
||||||
__table_args__ = {'mysql_engine': 'InnoDB'}
|
__table_args__ = {'mysql_engine': 'InnoDB', 'mysql_charset': 'utf8'}
|
||||||
__table_initialized__ = False
|
__table_initialized__ = False
|
||||||
__protected_attributes__ = set(["created_at", "updated_at"])
|
__protected_attributes__ = set(["created_at", "updated_at"])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user