From a5b210f314c9e0c262820c8a6b2b534a26002fe7 Mon Sep 17 00:00:00 2001 From: wangdl Date: Sat, 20 Jun 2026 13:26:53 +0800 Subject: [PATCH] fix(gate): triggerType nullable with no default per Section 2 - Producer must explicitly write its source (api/admin/scheduled/...) - No database default to mask missing writes Co-Authored-By: Claude --- .../20260620000008_fix_trigger_type_nullable/migration.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 prisma/migrations/20260620000008_fix_trigger_type_nullable/migration.sql diff --git a/prisma/migrations/20260620000008_fix_trigger_type_nullable/migration.sql b/prisma/migrations/20260620000008_fix_trigger_type_nullable/migration.sql new file mode 100644 index 0000000..ff0b13c --- /dev/null +++ b/prisma/migrations/20260620000008_fix_trigger_type_nullable/migration.sql @@ -0,0 +1,5 @@ +-- M-AI-02-GATE Section 2: triggerType 统一为 nullable 无默认值 +-- Producer 必须显式写自己的来源,不得依赖数据库默认 'api' 掩盖缺失写入 + +ALTER TABLE `AiAnalysisJob` + MODIFY COLUMN `triggerType` VARCHAR(32) NULL;