Files
AIclinicalresearch/backend/prisma/migrations/20260314_add_tenant_rvw_configs/migration.sql
HaHafeng 16179e16ca feat(rvw): deliver tenant portal v4 flow and config foundation
Implement RVW V4.0 tenant-aware backend/frontend flow with tenant routing, config APIs, and full portal UX updates. Sync system/RVW/deployment docs to capture verified upload-review-report workflow and next-step admin configuration work.

Made-with: Cursor
2026-03-14 22:29:40 +08:00

29 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.
-- RVW V4.0:新增期刊租户级审稿配置表
-- 每个期刊租户独立配置稿约规则、方法学/临床专家提示词、Handlebars 展示模板
-- Migration: 20260314_add_tenant_rvw_configs
CREATE TABLE "platform_schema"."tenant_rvw_configs" (
"id" TEXT NOT NULL,
"tenant_id" TEXT NOT NULL,
"editorial_rules" JSONB,
"methodology_expert_prompt" TEXT,
"methodology_handlebars_template" TEXT,
"data_forensics_level" TEXT NOT NULL DEFAULT 'L2',
"finer_weights" JSONB,
"clinical_expert_prompt" TEXT,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "tenant_rvw_configs_pkey" PRIMARY KEY ("id")
);
-- Unique constraint: 每个租户只有一份配置
CREATE UNIQUE INDEX "tenant_rvw_configs_tenant_id_key"
ON "platform_schema"."tenant_rvw_configs"("tenant_id");
-- Foreign key to tenants同 schema 内,可用标准外键)
ALTER TABLE "platform_schema"."tenant_rvw_configs"
ADD CONSTRAINT "tenant_rvw_configs_tenant_id_fkey"
FOREIGN KEY ("tenant_id") REFERENCES "platform_schema"."tenants"("id")
ON DELETE CASCADE ON UPDATE CASCADE;