Files
ITWorx-Pulse-Public/internal/database/migrations/0009_alert_hysteresis.sql
T
ITWorx Pulse release export bd774932d5
Public source validation / validate (push) Failing after 3m8s
Publish ITWorx Pulse source
2026-09-03 02:09:19 +02:00

9 lines
339 B
SQL

ALTER TABLE alert_rules
ADD COLUMN cooldown_seconds integer NOT NULL DEFAULT 0 CHECK (cooldown_seconds BETWEEN 0 AND 2592000);
ALTER TABLE alert_instances
ADD COLUMN cooldown_until timestamptz;
CREATE INDEX alert_instances_cooldown_idx ON alert_instances (cooldown_until, current_state, id)
WHERE cooldown_until IS NOT NULL;