From 9c1bf7d4eac8ee45f75f78deb46ec59425931ba2 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Thu, 25 Dec 2025 02:10:08 -0800 Subject: [PATCH] fix: Combine db prefix with type prefix for mol/wisp IDs (bd-hobo) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed prefix logic to combine the database prefix with the type prefix: - bd-wisp-xxx (was: wisp-xxx) - bd-mol-xxx (was: mol-xxx) This ensures IDs like hq-wisp-xxx at town level and gt-mol-xxx for gastown, maintaining database namespace while adding type recognition. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/storage/sqlite/queries.go | 5 +++-- internal/storage/sqlite/transaction.go | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/storage/sqlite/queries.go b/internal/storage/sqlite/queries.go index bf792d1d..6a55f5aa 100644 --- a/internal/storage/sqlite/queries.go +++ b/internal/storage/sqlite/queries.go @@ -163,10 +163,11 @@ func (s *SQLiteStorage) CreateIssue(ctx context.Context, issue *types.Issue, act return fmt.Errorf("failed to get config: %w", err) } - // Use IDPrefix override if set, otherwise use config prefix (bd-hobo) + // Use IDPrefix override if set, combined with config prefix (bd-hobo) + // e.g., configPrefix="bd" + IDPrefix="wisp" → "bd-wisp" prefix := configPrefix if issue.IDPrefix != "" { - prefix = issue.IDPrefix + prefix = configPrefix + "-" + issue.IDPrefix } // Generate or validate ID diff --git a/internal/storage/sqlite/transaction.go b/internal/storage/sqlite/transaction.go index 81fd72df..f854545e 100644 --- a/internal/storage/sqlite/transaction.go +++ b/internal/storage/sqlite/transaction.go @@ -147,10 +147,11 @@ func (t *sqliteTxStorage) CreateIssue(ctx context.Context, issue *types.Issue, a return fmt.Errorf("failed to get config: %w", err) } - // Use IDPrefix override if set, otherwise use config prefix (bd-hobo) + // Use IDPrefix override if set, combined with config prefix (bd-hobo) + // e.g., configPrefix="bd" + IDPrefix="wisp" → "bd-wisp" prefix := configPrefix if issue.IDPrefix != "" { - prefix = issue.IDPrefix + prefix = configPrefix + "-" + issue.IDPrefix } // Generate or validate ID