From d5e569443d82fe1dcf34c4993d026fdaba4a2553 Mon Sep 17 00:00:00 2001 From: Marco Del Pin Date: Thu, 18 Dec 2025 17:48:21 +0100 Subject: [PATCH] =?UTF-8?q?fix(schema):=20add=20metadata=20and=20thread=5F?= =?UTF-8?q?id=20to=20dependencies=20expectedSchema=20**Problem:**=20Schema?= =?UTF-8?q?=20compatibility=20probe=20was=20failing=20with=20"no=20such=20?= =?UTF-8?q?column:=20thread=5Fid"=20error=20when=20opening=20databases=20c?= =?UTF-8?q?reated=20before=20v0.30.5,=20even=20after=20running=20migration?= =?UTF-8?q?s.=20This=20caused=20database=20initialization=20to=20fail.=20*?= =?UTF-8?q?*Root=20Cause:**=20The=20migration=20020=5Fedge=5Fconsolidation?= =?UTF-8?q?.go=20correctly=20adds=20the=20metadata=20and=20thread=5Fid=20c?= =?UTF-8?q?olumns=20to=20the=20dependencies=20table,=20but=20schema=5Fprob?= =?UTF-8?q?e.go's=20expectedSchema=20map=20was=20missing=20these=20columns?= =?UTF-8?q?=20in=20its=20validation=20list.=20This=20caused=20verifySchema?= =?UTF-8?q?Compatibility()=20to=20fail=20even=20though:=201.=20The=20colum?= =?UTF-8?q?ns=20existed=20in=20the=20actual=20schema=20(schema.go:51-52)?= =?UTF-8?q?=202.=20Migration=20020=20would=20add=20them=20if=20missing=203?= =?UTF-8?q?.=20The=20database=20was=20otherwise=20valid=20**Solution:**=20?= =?UTF-8?q?Updated=20expectedSchema=20in=20schema=5Fprobe.go=20to=20includ?= =?UTF-8?q?e=20"metadata"=20and=20"thread=5Fid"=20in=20the=20dependencies?= =?UTF-8?q?=20table=20column=20list.=20This=20aligns=20the=20schema=20prob?= =?UTF-8?q?e=20expectations=20with=20the=20actual=20schema=20definition=20?= =?UTF-8?q?and=20migration=20020=20behavior.=20**Testing:**=20=E2=9C=85=20?= =?UTF-8?q?Tested=20on=205=20databases=20across=20version=20range=20pre-0.?= =?UTF-8?q?17.5=20=E2=86=92=20v0.30.5=20=20=20=20-=20All=20migrations=20co?= =?UTF-8?q?mpleted=20successfully=20=20=20=20-=20Schema=20probe=20passes?= =?UTF-8?q?=20after=20migration=20=20=20=20-=20All=20bd=20commands=20work?= =?UTF-8?q?=20correctly=20=E2=9C=85=20No=20regressions=20in=20fresh=20data?= =?UTF-8?q?base=20initialization=20**Impact:**=20-=20Fixes=20database=20in?= =?UTF-8?q?itialization=20errors=20for=20users=20upgrading=20from=20v0.30.?= =?UTF-8?q?3=20-=20No=20breaking=20changes=20or=20data=20migrations=20requ?= =?UTF-8?q?ired=20-=20Compatible=20with=20all=20existing=20databases=20-?= =?UTF-8?q?=20Enables=20smooth=20migration=20path=20for=20all=20database?= =?UTF-8?q?=20versions=20Fixes=20database=20migration=20issues=20reported?= =?UTF-8?q?=20in=20v0.30.5=20upgrade=20path.=20=F0=9F=A4=96=20Generated=20?= =?UTF-8?q?with=20Claude=20Code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/storage/sqlite/schema_probe.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/storage/sqlite/schema_probe.go b/internal/storage/sqlite/schema_probe.go index 07112e69..b06c8174 100644 --- a/internal/storage/sqlite/schema_probe.go +++ b/internal/storage/sqlite/schema_probe.go @@ -19,7 +19,7 @@ var expectedSchema = map[string][]string{ "created_at", "updated_at", "closed_at", "content_hash", "external_ref", "compaction_level", "compacted_at", "compacted_at_commit", "original_size", }, - "dependencies": {"issue_id", "depends_on_id", "type", "created_at", "created_by"}, + "dependencies": {"issue_id", "depends_on_id", "type", "created_at", "created_by", "metadata", "thread_id"}, "labels": {"issue_id", "label"}, "comments": {"id", "issue_id", "author", "text", "created_at"}, "events": {"id", "issue_id", "event_type", "actor", "old_value", "new_value", "comment", "created_at"},