Skip to main content

max / makenotwork

508 B · 16 lines History Blame Raw
1 -- Health monitoring history table for the background monitor loop.
2 -- Each row is a periodic health check snapshot (default every 60s).
3
4 CREATE TABLE health_history (
5 id BIGSERIAL PRIMARY KEY,
6 checked_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
7 status VARCHAR(20) NOT NULL,
8 db_ok BOOLEAN NOT NULL,
9 s3_ok BOOLEAN NOT NULL,
10 sessions_ok BOOLEAN NOT NULL,
11 check_duration_ms INTEGER NOT NULL,
12 details JSONB
13 );
14
15 CREATE INDEX idx_health_history_checked_at ON health_history(checked_at);
16