From 84c4a0c7c750bf8ac87d40fbf4071ff6ac0fc7e2 Mon Sep 17 00:00:00 2001
From: yeg <1347747024@qq.com>
Date: 星期四, 03 九月 2026 17:53:23 +0800
Subject: [PATCH] 修复测试预警异常迁移校验

---
 ruoyi-admin/src/main/resources/db/migration/V41__test_warning_exceptions.sql |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/ruoyi-admin/src/main/resources/db/migration/V41__test_warning_exceptions.sql b/ruoyi-admin/src/main/resources/db/migration/V41__test_warning_exceptions.sql
index b4dddf6..f19690b 100644
--- a/ruoyi-admin/src/main/resources/db/migration/V41__test_warning_exceptions.sql
+++ b/ruoyi-admin/src/main/resources/db/migration/V41__test_warning_exceptions.sql
@@ -17,7 +17,6 @@
     handled_at_utc DATETIME(3) NULL,
     handling_note VARCHAR(1000) NULL,
     PRIMARY KEY (exception_id),
-    open_threshold_id BIGINT GENERATED ALWAYS AS (IF(exception_status = 'OPEN', threshold_id, NULL)) STORED,
-    UNIQUE KEY uk_warning_exception_open (test_id, metric_code, open_threshold_id),
+    UNIQUE KEY uk_warning_exception_open (test_id, metric_code, threshold_id, exception_status),
     KEY idx_warning_exception_query (test_id, exception_status, last_occurred_at_utc)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='测试预警阈值异常';

--
Gitblit v1.7.1