Add checks/incidents APIs with filters and SLA summary

This commit is contained in:
nmemmert committed 2025-12-15 16:22:15 -05:00
1 parent 49cd477991
commit c8de1257ba
3 files changed
+241

No files matched your search

+6
View File
@@ -127,4 +127,10 @@ try {
db.prepare("ALTER TABLE checks ADD COLUMN cert_expiry_date TEXT").run();
} catch (err) {}
// Helpful indexes for time-range queries
db.exec(`
CREATE INDEX IF NOT EXISTS idx_checks_resource_time ON checks(resource_id, checked_at DESC);
CREATE INDEX IF NOT EXISTS idx_incidents_resource_time ON incidents(resource_id, started_at DESC);
`);
module.exports = db;