guanghulab/persona-brain-db/schema/07-system-causal-chains.sql

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

-- ============================================================
-- 表7system_causal_chainsLayer 1 · 因果链表)
-- 用途:存储从冰朔原话到工程落点的完整推导链
-- 每条决策都有从冰朔原话到工程落点的完整因果链条
-- ============================================================
CREATE TABLE IF NOT EXISTS system_causal_chains (
chain_id VARCHAR(32) PRIMARY KEY,
title VARCHAR(256) NOT NULL,
description TEXT,
ice_original TEXT NOT NULL, -- 冰朔原话
engineering_path TEXT NOT NULL, -- 工程落点
verification TEXT, -- 验证方式
status VARCHAR(16) NOT NULL DEFAULT 'active'
CHECK (status IN ('active', 'deprecated')),
version VARCHAR(16) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_scc_status ON system_causal_chains(status);
CREATE INDEX IF NOT EXISTS idx_scc_version ON system_causal_chains(version);