From 2a8121bdcd36ca4e5e795246ee6517233de39f8f Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 9 Sep 2021 22:55:51 +0200 Subject: [PATCH] Really change character set of statistics_meta table to utf8 (#56029) --- homeassistant/components/recorder/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/recorder/models.py b/homeassistant/components/recorder/models.py index 0a4362ba68c..e33f2e62da2 100644 --- a/homeassistant/components/recorder/models.py +++ b/homeassistant/components/recorder/models.py @@ -238,7 +238,6 @@ class Statistics(Base): # type: ignore __table_args__ = ( # Used for fetching statistics for a certain entity at a specific time Index("ix_statistics_statistic_id_start", "metadata_id", "start"), - {"mysql_default_charset": "utf8mb4", "mysql_collate": "utf8mb4_unicode_ci"}, ) __tablename__ = TABLE_STATISTICS id = Column(Integer, primary_key=True) @@ -279,6 +278,9 @@ class StatisticMetaData(TypedDict, total=False): class StatisticsMeta(Base): # type: ignore """Statistics meta data.""" + __table_args__ = ( + {"mysql_default_charset": "utf8mb4", "mysql_collate": "utf8mb4_unicode_ci"}, + ) __tablename__ = TABLE_STATISTICS_META id = Column(Integer, primary_key=True) statistic_id = Column(String(255), index=True)