guanghulab/persona-brain-db/schema/19-persona-growth-records.sql

25 lines
1.3 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- ============================================================
-- 表19persona_growth_recordsLayer 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);