feat(store): add status pages and their components

Composite foreign keys keep pages from listing monitors of other
organizations, independent of row-level security.

Refs #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-22 08:39:00 +01:00
1 parent b831478143
commit d820547e8c
9 files changed
+570

No files matched your search

+7
View File
@@ -48,3 +48,10 @@ FROM check_results_1d
WHERE org_id = $1 AND monitor_id = $2 AND bucket >= $3
GROUP BY bucket
ORDER BY bucket;
-- name: DailyBucketsForMonitors :many
SELECT monitor_id, bucket::timestamptz AS bucket, sum(total)::bigint AS total, sum(ok_count)::bigint AS ok_count
FROM check_results_1d
WHERE org_id = $1 AND monitor_id = ANY (sqlc.arg(ids)::uuid[]) AND bucket >= $2
GROUP BY monitor_id, bucket
ORDER BY monitor_id, bucket;