ALTER TABLE alert_rule
    ADD COLUMN suppress_window_minute INT NOT NULL DEFAULT 0 AFTER window_minute;

ALTER TABLE alert_event
    ADD COLUMN status VARCHAR(32) NOT NULL DEFAULT 'ACTIVE' AFTER alert_level,
    ADD COLUMN recovered_at DATETIME DEFAULT NULL AFTER created_at;

UPDATE alert_rule
SET suppress_window_minute = 5
WHERE rule_code IN ('API_5XX_RATE', 'ASYNC_FAILED_RATE') AND suppress_window_minute = 0;
