1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-20 02:48:57 +00:00

Log when failing to remove foreign key in recorder EventIDPostMigration (#153812)

This commit is contained in:
Erik Montnemery
2025-10-06 10:58:47 +02:00
committed by GitHub
parent 4a6d2017fd
commit 1c1fbe0ec1

View File

@@ -2964,7 +2964,12 @@ class EventIDPostMigration(BaseRunTimeMigration):
_drop_foreign_key_constraints(
session_maker, instance.engine, TABLE_STATES, "event_id"
)
except (InternalError, OperationalError):
except (InternalError, OperationalError) as err:
_LOGGER.debug(
"Could not drop foreign key constraint on states.event_id, "
"will try again later",
exc_info=err,
)
fk_remove_ok = False
else:
fk_remove_ok = True