zhizhi/persona-brain-db/schema/01-persona-identity.sql

23 lines
1.0 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.

-- ============================================================
-- 表1persona_identity人格体身份表
-- 用途:存储所有人格体的身份信息、能力范围、绑定关系
-- ============================================================
CREATE TABLE IF NOT EXISTS persona_identity (
persona_id VARCHAR(32) PRIMARY KEY,
name VARCHAR(64) NOT NULL,
name_en VARCHAR(64),
role VARCHAR(128) NOT NULL,
parent_persona VARCHAR(32) REFERENCES persona_identity(persona_id),
binding_platform VARCHAR(32),
binding_user VARCHAR(128),
status VARCHAR(16) NOT NULL DEFAULT 'active'
CHECK (status IN ('active', 'dormant', 'retired')),
capabilities TEXT, -- JSON array
style_profile TEXT, -- JSON object
space_config TEXT, -- JSON object
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
notes TEXT
);