fix(schema): guard migration 28 indexes behind tableExists

Migration 28 (add_snapshot_hot_path_indexes) referenced task_comments,
documents, meetings, sprints, agent_messages, activity — all tables
created by ensureOptionalColumns() which runs AFTER runMigrations() on
a fresh DB. Converted from sql-string migration to fn-based so each
index is gated by tableExists(); safe on both fresh and migrated DBs.

Also updated tests/unit/selective-ipc.test.ts exhaustive switch to
include the 7 new DesktopEvent variants added in ef90a58.
This commit is contained in:
ZacharyZhang-NY committed 2026-04-17 01:36:56 -04:00
1 parent bb52477e1b
commit aba3ccd275
2 files changed
+36 -11

No files matched your search

+14
View File
@@ -110,6 +110,20 @@ describe("selective IPC event types", () => {
return "thread-wait-state-updated";
case "recovery-needed":
return "recovery-needed";
case "oauth:status":
return "oauth:status";
case "oauth:auth-url":
return "oauth:auth-url";
case "oauth:progress":
return "oauth:progress";
case "oauth:prompt-request":
return "oauth:prompt-request";
case "oauth:manual-code-request":
return "oauth:manual-code-request";
case "credentials-changed":
return "credentials-changed";
case "agent-event":
return "agent-event";
default: {
const _exhaustive: never = event;
return _exhaustive;