Merge "Make utf8 the default charset for mysql"

This commit is contained in:
Jenkins 2015-08-06 05:30:25 +00:00 committed by Gerrit Code Review
commit 09aedd3400
3 changed files with 9 additions and 9 deletions

View File

@ -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"])

View File

@ -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()))

View File

@ -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"])