test(repo): add wiki_config + indexing_strategy to sqlite test DDL

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.
This commit is contained in:
taoyang
2026-05-17 11:36:33 +08:00
committed by lyingbug
parent 5141a1230c
commit b3004f73d4
@@ -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