Files
awoooi/apps/api/migrations/phase23_risklevel_add_high.sql
OG T a1f7d1f495
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 6m58s
E2E Health Check / e2e-health (push) Successful in 18s
fix(db): 固化 risklevel ADD VALUE 'high' 為正式 migration
Phase 23 緊急修復已在 prod/dev 手動執行,此檔作為正式記錄
使用 DO 塊防止重複執行錯誤

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 21:36:15 +08:00

24 lines
919 B
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.
-- =============================================================================
-- Phase 23: risklevel ENUM 新增 HIGH 值
-- =============================================================================
-- 執行日期: 2026-04-01
-- 執行者: ogt
-- 背景: Sentry Webhook 送入 risk_level="HIGH" 時 DB 拋 InvalidTextRepresentation
-- 已在 prod/dev 緊急執行,此檔固化為正式 migration record
-- =============================================================================
-- PostgreSQL ENUM 不支援 IF NOT EXISTS使用 DO 塊避免重複執行錯誤
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_enum
WHERE enumtypid = 'risklevel'::regtype
AND enumlabel = 'high'
) THEN
ALTER TYPE risklevel ADD VALUE 'high';
END IF;
END
$$;
COMMENT ON TYPE risklevel IS 'Risk level enum: low | medium | high | critical. HIGH added Phase 23 (2026-04-01)';