-- PR-B.2 (May 2026): Monitor.requiredUps — symmetric up-side hysteresis
-- =========================================================
-- The confirmed-state engine required N consecutive `down` heartbeats
-- (Monitor.retries) before flipping to down, but a single `up`
-- heartbeat to flip back. A monitor flapping in the 6-min window
-- around the retries threshold could produce alert-silence-alert
-- cycles. Mirroring the down-side hysteresis on the up-side closes
-- that gap.
--
-- Default 2 catches typical recovery flaps without delaying genuine
-- recovery noticeably. Operators tune per-monitor via the existing
-- monitor edit UI (one new numeric input).
--
-- Same pattern as Theme B/C: this project uses `prisma db push`, so
-- this SQL documents the change for review + serves as the explicit
-- rollback record per CLAUDE.md.

-- ============================================================
-- UP
-- ============================================================

ALTER TABLE `Monitor`
  ADD COLUMN `requiredUps` INT NOT NULL DEFAULT 2;

-- ============================================================
-- DOWN
-- ============================================================
-- Safe: column has a default value, no FK, only read by the engine.

ALTER TABLE `Monitor`
  DROP COLUMN `requiredUps`;
