···11+-- Drop the old CHECK constraint and add new one with additional statuses
22+-- SQLite doesn't support ALTER CONSTRAINT, so we recreate the table
33+CREATE TABLE pings_new (
44+ id INTEGER PRIMARY KEY AUTOINCREMENT,
55+ service_id TEXT NOT NULL,
66+ timestamp INTEGER NOT NULL,
77+ status TEXT NOT NULL CHECK (status IN ('up', 'degraded', 'misconfigured', 'down', 'unknown')),
88+ latency_ms INTEGER
99+);
1010+1111+INSERT INTO pings_new SELECT * FROM pings;
1212+1313+DROP TABLE pings;
1414+1515+ALTER TABLE pings_new RENAME TO pings;
1616+1717+CREATE INDEX idx_pings_service_ts ON pings (service_id, timestamp DESC);