fix(db): 重编号合并后撞号 migration,并修 admin e2e base

将 015–023 双文件冲突线性化为 015–050;提供已有库 schema_migrations 修复脚本;admin Playwright 对齐 /psy/admin/ 预览路径。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-13 02:14:52 +08:00
co-authored by Cursor
parent 0d50c0ee73
commit b7b0b18802
72 changed files with 133 additions and 4 deletions
@@ -0,0 +1,42 @@
-- ECR-021 AICoreConfig SystemPrompt (read catalog)
CREATE TABLE IF NOT EXISTS system_prompts (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
code varchar(64) NOT NULL UNIQUE,
title varchar(128) NOT NULL,
scene varchar(32) NULL,
body text NOT NULL,
version int NOT NULL DEFAULT 1 CHECK (version > 0),
active boolean NOT NULL DEFAULT true,
system boolean NOT NULL DEFAULT false,
created_at timestamptz NOT NULL DEFAULT now(),
updated_at timestamptz NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_system_prompts_active ON system_prompts(active);
INSERT INTO system_prompts(code, title, scene, body, version, active, system)
VALUES (
'ask_default',
'问答默认系统提示',
NULL,
$prompt$你是 AI
宿
{{display_name}} · {{relation}} · {{birth_date}} · {{scene}} · {{report_ctx}}
$prompt$,
1,
true,
true
)
ON CONFLICT (code) DO NOTHING;
INSERT INTO admin_role_permissions(role_id, code)
SELECT r.id, 'admin.ai_config.read'
FROM admin_roles r
WHERE r.name = 'super_admin'
ON CONFLICT DO NOTHING;