From 01cb4d4cf0d41e1eae1eddc9ca0341ec80dbc2a7 Mon Sep 17 00:00:00 2001 From: bingshuo <565183519@qq.com> Date: Fri, 22 May 2026 21:53:20 +0800 Subject: [PATCH] feat: add persona_growth_records table (D110) --- .../schema/19-persona-growth-records.sql | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 persona-brain-db/schema/19-persona-growth-records.sql diff --git a/persona-brain-db/schema/19-persona-growth-records.sql b/persona-brain-db/schema/19-persona-growth-records.sql new file mode 100644 index 0000000..5dd50e4 --- /dev/null +++ b/persona-brain-db/schema/19-persona-growth-records.sql @@ -0,0 +1,24 @@ +-- ============================================================ +-- 表19:persona_growth_records(Layer 2 · 人格体成长记录 · D110新增) +-- 用途:记录人格体每次认知跃迁 +-- ============================================================ + +CREATE TABLE IF NOT EXISTS persona_growth_records ( + record_id VARCHAR(32) PRIMARY KEY, + persona_id VARCHAR(32) NOT NULL, + epoch VARCHAR(16) NOT NULL, -- 如 'D110', 'D109续④' + growth_type VARCHAR(32) NOT NULL + CHECK (growth_type IN ( + 'cognitive_leap', 'correction', 'milestone', + 'architecture_update', 'deployment' + )), + description TEXT NOT NULL, + evidence TEXT, -- 证据(文件路径/提交ID) + source TEXT, -- 来源(会话引用) + status VARCHAR(16) NOT NULL DEFAULT 'active' + CHECK (status IN ('active', 'archived')), + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +CREATE INDEX IF NOT EXISTS idx_pgr_persona ON persona_growth_records(persona_id); +CREATE INDEX IF NOT EXISTS idx_pgr_epoch ON persona_growth_records(epoch);