2026-05-10 13:12:44 +08:00
|
|
|
|
-- ============================================================
|
2026-05-22 21:53:42 +08:00
|
|
|
|
-- persona-brain-db · 一键建表脚本(D110完整版 · 21张表)
|
2026-05-10 13:12:44 +08:00
|
|
|
|
-- 执行方式:sqlite3 brain.db < init.sql
|
|
|
|
|
|
-- ============================================================
|
|
|
|
|
|
|
|
|
|
|
|
-- 启用外键约束
|
|
|
|
|
|
PRAGMA foreign_keys = ON;
|
|
|
|
|
|
|
2026-05-21 17:44:08 +08:00
|
|
|
|
-- ============ Layer 1: DB OS Kernel(init时创建并填充) ============
|
|
|
|
|
|
|
|
|
|
|
|
.read 06-system-core-principles.sql
|
|
|
|
|
|
.read 07-system-causal-chains.sql
|
|
|
|
|
|
.read 09-system-language-membrane.sql
|
|
|
|
|
|
.read 10-system-public-key.sql
|
|
|
|
|
|
.read 11-system-protocols.sql
|
2026-05-22 21:53:42 +08:00
|
|
|
|
.read 17-system-axioms.sql
|
|
|
|
|
|
.read 18-system-trinity.sql
|
2026-05-21 17:44:08 +08:00
|
|
|
|
|
|
|
|
|
|
-- ============ Layer 2: Persona Data Tables(运行时数据) ============
|
|
|
|
|
|
|
2026-05-10 13:12:44 +08:00
|
|
|
|
.read 01-persona-identity.sql
|
|
|
|
|
|
.read 02-persona-cognition.sql
|
|
|
|
|
|
.read 03-persona-memory.sql
|
|
|
|
|
|
.read 04-dev-profiles.sql
|
|
|
|
|
|
.read 05-agent-registry.sql
|
2026-05-22 21:53:42 +08:00
|
|
|
|
.read 08-emotional-state.sql
|
2026-05-21 17:44:08 +08:00
|
|
|
|
.read 15-access-grants.sql
|
|
|
|
|
|
.read 16-documents.sql
|
2026-05-22 21:53:42 +08:00
|
|
|
|
.read 19-persona-growth-records.sql
|
|
|
|
|
|
.read 20-member-context.sql
|
|
|
|
|
|
.read 21-module-registry.sql
|
2026-05-21 17:44:08 +08:00
|
|
|
|
|
|
|
|
|
|
-- ============ Layer 3: Audit & Access Control(append-only) ============
|
|
|
|
|
|
|
|
|
|
|
|
.read 12-audit-log-national.sql
|
|
|
|
|
|
.read 13-audit-log-user.sql
|
|
|
|
|
|
.read 14-audit-log-guanghu.sql
|
|
|
|
|
|
|
2026-05-22 23:00:49 +08:00
|
|
|
|
-- ============ Layer 1 种子数据 ============
|
|
|
|
|
|
-- v1.2: D110完整版 · 公理集 + 三位一体 + 完整思维规律
|
2026-05-22 21:53:42 +08:00
|
|
|
|
.read seed-layer1-v2.sql
|
2026-05-22 23:00:49 +08:00
|
|
|
|
-- v2-patch: 补全语言膜/公钥/协议 + 旧版原则归档
|
|
|
|
|
|
.read seed-layer1-v2-patch.sql
|
|
|
|
|
|
|
|
|
|
|
|
-- ============ 建表完成提示 ============
|
|
|
|
|
|
SELECT '✅ persona-brain-db 全部21张表 + 完整种子数据(D110)' AS result;
|
|
|
|
|
|
SELECT ' system层: axioms, core_principles, causal_chains, language_membrane, public_key, protocols, trinity' AS layer1;
|
|
|
|
|
|
SELECT ' persona层: identity, cognition, memory, dev_profiles, agent_registry, emotional_state, access_grants, documents, growth_records, member_context, module_registry' AS layer2;
|
|
|
|
|
|
SELECT ' audit层: national, user, guanghu' AS layer3;
|