Files
AIclinicalresearch/backend/create_mock_user_platform.sql
HaHafeng 4ed67a8846 fix(admin): Fix Prompt management list not showing version info and add debug diagnostics
Summary:
- Fix Prompt list API response schema missing activeVersion and draftVersion fields
- Fastify was filtering out undefined schema fields, causing version columns to show empty
- Add detailed diagnostic logging for Prompt debug mode troubleshooting
- Verify debug mode works correctly (DRAFT version is used when debug enabled)

Changes:
- backend/src/common/prompt/prompt.routes.ts: Add activeVersion and draftVersion to response schema
- backend/src/common/prompt/prompt.service.ts: Add diagnostic logs for setDebugMode and get methods
- PKB module: Various authentication and document handling fixes from previous session

Tested: Debug mode verified working - v2 DRAFT version correctly loaded when debug enabled
2026-01-13 22:22:10 +08:00

57 lines
827 B
SQL

-- 在 platform_schema.users 中创建 mock 用户
-- 用于 PKB 等模块的测试
-- 首先需要一个默认租户
INSERT INTO platform_schema.tenants (id, code, name, type, status, created_at, updated_at)
VALUES (
'tenant-mock-001',
'mock-tenant',
'测试租户',
'INTERNAL',
'ACTIVE',
NOW(),
NOW()
)
ON CONFLICT (id) DO NOTHING;
-- 创建 mock 用户
INSERT INTO platform_schema.users (
id,
phone,
email,
password,
is_default_password,
name,
role,
status,
tenant_id,
kb_quota,
kb_used,
is_trial,
created_at,
updated_at
)
VALUES (
'user-mock-001',
'13800000000',
'mock@test.com',
'$2b$10$mockhashedpassword123456789',
true,
'测试用户',
'USER',
'active',
'tenant-mock-001',
3,
0,
false,
NOW(),
NOW()
)
ON CONFLICT (id) DO NOTHING;