feat(ECR-031): CrisisCare CrisisEvent 只读并 Closed

CrisisEvent catalog (000032) · Loop continuous.
This commit is contained in:
jackyu66git
2026-08-08 03:15:16 +08:00
parent 0d4bc5054e
commit 24a115297b
24 changed files with 453 additions and 1 deletions
@@ -0,0 +1 @@
DROP TABLE IF EXISTS crisis_events;
@@ -0,0 +1,18 @@
-- ECR-031 CrisisEvent (read catalog)
CREATE TABLE IF NOT EXISTS crisis_events (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
code varchar(64) NOT NULL UNIQUE,
title varchar(128) NOT NULL,
severity varchar(16) NOT NULL CHECK (severity IN ('high','critical')),
active boolean NOT NULL DEFAULT true,
system boolean NOT NULL DEFAULT false,
created_at timestamptz NOT NULL DEFAULT now(),
updated_at timestamptz NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_crisis_events_active ON crisis_events(active);
INSERT INTO crisis_events(code, title, severity, active, system)
VALUES ('demo_crisis_event', '示例危机事件占位', 'high', true, true)
ON CONFLICT (code) DO NOTHING;