From 616e6e6ae8b914c6992ae802d35767872d135b60 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 21 Mar 2023 07:14:27 -1000 Subject: [PATCH] Fix missing length on context id and incorrect precision with MariaDB (dev only fix) (#90058) Fix missing length on context id column with MariaDB spotted by @dcoder42 The migration still worked as intented but the blob should have been a bit smaller. This only affects dev so there is no need for a backport --- homeassistant/components/recorder/migration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/recorder/migration.py b/homeassistant/components/recorder/migration.py index a4dea027d8c..419ef7aa117 100644 --- a/homeassistant/components/recorder/migration.py +++ b/homeassistant/components/recorder/migration.py @@ -549,7 +549,7 @@ def _apply_update( # noqa: C901 if dialect == SupportedDialect.MYSQL: timestamp_type = "DOUBLE PRECISION" context_bin_type = f"BLOB({CONTEXT_ID_BIN_MAX_LENGTH})" - if dialect == SupportedDialect.POSTGRESQL: + elif dialect == SupportedDialect.POSTGRESQL: timestamp_type = "DOUBLE PRECISION" context_bin_type = "BYTEA" else: