From f874258e7e6c6996cb7db58cf63abde99333d73d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 30 Jan 2023 07:38:33 -1000 Subject: [PATCH] Silence spurious warnings about removing ix_states_entity_id with newer installs (#86961) * Silence spurious warnings about removing ix_states_entity_id with newer installs https://ptb.discord.com/channels/330944238910963714/427516175237382144/1069648035459641465 * Silence spurious warnings about removing ix_states_entity_id with newer installs https://ptb.discord.com/channels/330944238910963714/427516175237382144/1069648035459641465 --- homeassistant/components/recorder/migration.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/recorder/migration.py b/homeassistant/components/recorder/migration.py index cf1a1f8b656..942512e6a41 100644 --- a/homeassistant/components/recorder/migration.py +++ b/homeassistant/components/recorder/migration.py @@ -274,9 +274,13 @@ def _drop_index( "Finished dropping index %s from table %s", index_name, table_name ) else: - if index_name == "ix_states_context_parent_id": - # Was only there on nightly so we do not want + if index_name in ("ix_states_entity_id", "ix_states_context_parent_id"): + # ix_states_context_parent_id was only there on nightly so we do not want # to generate log noise or issues about it. + # + # ix_states_entity_id was only there for users who upgraded from schema + # version 8 or earlier. Newer installs will not have it so we do not + # want to generate log noise or issues about it. return _LOGGER.warning(