From b3004f73d480e4d5c97e39d7ec1cfe93d14c7410 Mon Sep 17 00:00:00 2001 From: taoyang Date: Sun, 17 May 2026 11:36:33 +0800 Subject: [PATCH] test(repo): add wiki_config + indexing_strategy to sqlite test DDL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The in-memory SQLite DDL in `knowledgebase_sqlite_test.go` mirrors the `knowledge_bases` columns the tests need to insert against. It missed two columns that the `KnowledgeBase` struct has been carrying for a while: - `wiki_config` (gorm:"column:wiki_config;type:json") - `indexing_strategy` (gorm:"column:indexing_strategy;type:json") Without those columns the `INSERT INTO knowledge_bases (...)` statement GORM emits fails with: table knowledge_bases has no column named wiki_config …which cascades to every TestKnowledgeBase_VectorStoreID_* test failing on a fresh `go test ./internal/application/repository/`. Reproduce on main (before this commit): go test ./internal/application/repository/ -count=1 ... --- FAIL: TestKnowledgeBase_VectorStoreID_Save_Immutable (0.00s) knowledgebase_sqlite_test.go:91: Received unexpected error: table knowledge_bases has no column named wiki_config FAIL github.com/Tencent/WeKnora/internal/application/repository After this commit: ok github.com/Tencent/WeKnora/internal/application/repository The fix is two `TEXT NULL` column additions to the inline DDL. No production code, no migration, no schema change — strictly aligning the test scaffold with the model fields that already exist. --- internal/application/repository/knowledgebase_sqlite_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/application/repository/knowledgebase_sqlite_test.go b/internal/application/repository/knowledgebase_sqlite_test.go index dc55c47f..2f264846 100644 --- a/internal/application/repository/knowledgebase_sqlite_test.go +++ b/internal/application/repository/knowledgebase_sqlite_test.go @@ -37,6 +37,8 @@ CREATE TABLE IF NOT EXISTS knowledge_bases ( pinned_at DATETIME NULL, asr_config TEXT, vector_store_id VARCHAR(36), + wiki_config TEXT, + indexing_strategy TEXT, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP, deleted_at DATETIME