将 015–023 双文件冲突线性化为 015–050;提供已有库 schema_migrations 修复脚本;admin Playwright 对齐 /psy/admin/ 预览路径。 Co-authored-by: Cursor <cursoragent@cursor.com>
20 lines
788 B
SQL
20 lines
788 B
SQL
-- ECR-027 KnowledgeChunk (read catalog)
|
|
|
|
CREATE TABLE IF NOT EXISTS knowledge_chunks (
|
|
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
code varchar(64) NOT NULL UNIQUE,
|
|
source_code varchar(64) NOT NULL,
|
|
title varchar(128) NOT NULL,
|
|
body text NOT NULL,
|
|
active boolean NOT NULL DEFAULT true,
|
|
system boolean NOT NULL DEFAULT false,
|
|
created_at timestamptz NOT NULL DEFAULT now(),
|
|
updated_at timestamptz NOT NULL DEFAULT now()
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_knowledge_chunks_active ON knowledge_chunks(active);
|
|
|
|
INSERT INTO knowledge_chunks(code, source_code, title, body, active, system)
|
|
VALUES ('ask_grounding_intro', 'ask_grounding', '问答 grounding 引言块', '愈心谷提供陪伴式成长对话,非医疗诊断。', true, true)
|
|
ON CONFLICT (code) DO NOTHING;
|