From 2a773e979e2e4c9dd89a53c084f6664dfcf90c1c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 9 Mar 2023 15:43:41 -1000 Subject: [PATCH] speed up --- 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 1338cab39f6..5f81af68654 100644 --- a/homeassistant/components/recorder/migration.py +++ b/homeassistant/components/recorder/migration.py @@ -1312,7 +1312,7 @@ def migrate_event_type_ids(instance: Recorder) -> bool: for event_type in missing_event_types ] session.add_all(missing_db_event_types) - session.commit() + session.flush() # Assign ids for db_event_type in missing_db_event_types: assert db_event_type.event_type is not None event_type_to_id[