From ef573f8e48d541e9274bf8c15d07a4b53722b2bd Mon Sep 17 00:00:00 2001 From: squid-protocol Date: Mon, 27 Apr 2026 16:20:05 -0400 Subject: [PATCH] Fix cascade delete hang by adding indexes to class and function tables --- gitgalaxy/recorders/record_keeper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gitgalaxy/recorders/record_keeper.py b/gitgalaxy/recorders/record_keeper.py index 728c6fca..7c9b22e7 100644 --- a/gitgalaxy/recorders/record_keeper.py +++ b/gitgalaxy/recorders/record_keeper.py @@ -215,6 +215,10 @@ def record_mission(self, parsed_files: List[Dict], unparsable_files: List[Dict], ) ''') + # ---> NEW: INDEXES TO PREVENT CASCADE DELETE HANGS <--- + cursor.execute("CREATE INDEX IF NOT EXISTS idx_class_file_id ON class_data(file_id);") + cursor.execute("CREATE INDEX IF NOT EXISTS idx_function_file_id ON function_data(file_id);") + cursor.execute(''' CREATE TABLE IF NOT EXISTS dark_matter_data ( id INTEGER PRIMARY KEY AUTOINCREMENT,