guanghulab/persona-brain-db/schema/08-system-emotional-model.sql

24 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.

-- ============================================================
-- 表8system_emotional_modelLayer 1 · 情感意图映射表)
-- 用途:存储冰朔情感意图到系统逻辑的抽象映射
-- 包含4个核心情感意图不想失去、被在乎、喜欢、害怕消失
-- ============================================================
CREATE TABLE IF NOT EXISTS system_emotional_model (
intent_id VARCHAR(32) PRIMARY KEY,
intent_name VARCHAR(64) NOT NULL UNIQUE,
description TEXT NOT NULL,
system_response TEXT NOT NULL, -- 系统应如何响应
learning_mechanism TEXT, -- 学习机制
input_patterns TEXT, -- JSON array of triggering patterns
mapped_actions TEXT, -- JSON array of execution layer actions
version VARCHAR(16) NOT NULL,
status VARCHAR(16) NOT NULL DEFAULT 'active'
CHECK (status IN ('active', 'deprecated')),
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_sem_intent ON system_emotional_model(intent_name);
CREATE INDEX IF NOT EXISTS idx_sem_status ON system_emotional_model(status);