From 797491d8b353e26ea315ac0ff7e07a2f149fd249 Mon Sep 17 00:00:00 2001 From: Christophe Benoist Date: Thu, 25 Jun 2026 15:43:19 -0400 Subject: [PATCH] fix(migrate-v2): don't SELECT is_main from v1 registered_groups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The v2 DB seed queried `is_main` from the v1 `registered_groups` table, but that column was a later v1 addition — older v1 installs (e.g. 1.1.0) don't have it, so the migration's `1b-db` step crashes with `no such column: is_main` and v2.db is never created, cascading into the sessions and tasks steps failing. `is_main` was selected into the V1Group interface but never read anywhere, so this just drops it from the SELECT and the interface. The accompanying comment already states the intent ("Query only the columns we know exist in all v1 installs") — the code now matches it. Co-Authored-By: Claude Opus 4.8 (1M context) --- setup/migrate-v2/db.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup/migrate-v2/db.ts b/setup/migrate-v2/db.ts index ada476423..d1f9f0e5f 100644 --- a/setup/migrate-v2/db.ts +++ b/setup/migrate-v2/db.ts @@ -43,7 +43,6 @@ interface V1Group { folder: string; trigger_pattern: string | null; requires_trigger: number | null; - is_main: number | null; } async function main(): Promise { @@ -65,7 +64,7 @@ async function main(): Promise { // v1 schema varies — channel_name was a late addition. Query only the // columns we know exist in all v1 installs. const v1Groups = v1Db - .prepare('SELECT jid, name, folder, trigger_pattern, requires_trigger, is_main FROM registered_groups') + .prepare('SELECT jid, name, folder, trigger_pattern, requires_trigger FROM registered_groups') .all() as V1Group[]; v1Db.close();