fix(km): backfill symptoms hash read column
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m7s
CD Pipeline / build-and-deploy (push) Successful in 4m50s
CD Pipeline / post-deploy-checks (push) Successful in 3m37s

This commit is contained in:
ogt
2026-07-09 17:27:08 +08:00
parent 4f87ad97f3
commit 4018548552
3 changed files with 25 additions and 3 deletions

View File

@@ -255,3 +255,16 @@ def test_api_lifespan_closes_worker_redis_pool_after_signal_worker() -> None:
assert "close_worker_redis_pool" in source
assert source.index("close_signal_worker") < source.index("close_worker_redis_pool")
assert source.index("close_worker_redis_pool") < source.index("close_redis_pool")
def test_init_db_backfills_all_optional_knowledge_read_columns() -> None:
import inspect
from src.db import base as db_base
source = inspect.getsource(db_base._run_init_db_ddl)
assert "ALTER TABLE knowledge_entries" in source
assert "ADD COLUMN IF NOT EXISTS related_approval_id" in source
assert "ADD COLUMN IF NOT EXISTS path_type" in source
assert "ADD COLUMN IF NOT EXISTS symptoms_hash" in source
assert "CREATE INDEX IF NOT EXISTS ix_knowledge_symptoms_hash" in source