feat(store): let regions and agents belong to the platform or one organization

Regions are identified by id so organizations can reuse keys. Triggers
keep agents in regions of the same owner and monitors in platform or own
regions. Platform admins are a user flag.

Refs #52

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 01:36:02 +01:00
1 parent 7bb4afa04a
commit 607798d742
10 files changed
+442 -99

No files matched your search

+6
View File
@@ -25,3 +25,9 @@ DELETE FROM users WHERE id = $1;
-- name: SetUserLocale :exec
UPDATE users SET locale = $2, updated_at = now() WHERE id = $1;
-- name: SetUserAdmin :execrows
UPDATE users SET is_admin = $2, updated_at = now() WHERE email = $1;
-- name: MakeAdmin :exec
UPDATE users SET is_admin = true, updated_at = now() WHERE id = $1;