Summary: - Add 4 new database tables: iit_field_metadata, iit_qc_logs, iit_record_summary, iit_qc_project_stats - Implement pg-boss debounce mechanism in WebhookController - Refactor QC Worker for dual output: QC logs + record summary - Enhance HardRuleEngine to support form-based rule filtering - Create QcService for QC data queries - Optimize ChatService with new intents: query_enrollment, query_qc_status - Add admin batch operations: one-click full QC + one-click full summary - Create IIT Admin management module: project config, QC rules, user mapping Status: Code complete, pending end-to-end testing Co-authored-by: Cursor <cursoragent@cursor.com>
98 lines
1.2 KiB
SQL
98 lines
1.2 KiB
SQL
-- CreateTable (merged from create_tool_c_session.sql for shadow database compatibility)
|
|
CREATE TABLE IF NOT EXISTS "dc_schema"."dc_tool_c_sessions" (
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
user_id VARCHAR(255) NOT NULL,
|
|
file_name VARCHAR(500) NOT NULL,
|
|
file_key VARCHAR(500) NOT NULL,
|
|
total_rows INTEGER NOT NULL,
|
|
total_cols INTEGER NOT NULL,
|
|
columns JSONB NOT NULL,
|
|
encoding VARCHAR(50),
|
|
file_size INTEGER NOT NULL,
|
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
expires_at TIMESTAMP NOT NULL
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_dc_tool_c_sessions_user_id ON "dc_schema"."dc_tool_c_sessions"(user_id);
|
|
CREATE INDEX IF NOT EXISTS idx_dc_tool_c_sessions_expires_at ON "dc_schema"."dc_tool_c_sessions"(expires_at);
|
|
|
|
-- AlterTable
|
|
-- 添加 column_mapping 字段到 dc_tool_c_sessions 表
|
|
-- 用于解决表头特殊字符问题
|
|
|
|
ALTER TABLE "dc_schema"."dc_tool_c_sessions"
|
|
ADD COLUMN IF NOT EXISTS "column_mapping" JSONB;
|
|
|
|
-- 添加注释
|
|
COMMENT ON COLUMN "dc_schema"."dc_tool_c_sessions"."column_mapping" IS '列名映射:[{originalName, safeName, displayName}] 解决特殊字符问题';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|