Built-in roles are seeded with fixed ids and are read-only for every org. Existing non-owner members receive the Viewer role. Refs #6, #7, #8, #9 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
21 lines
462 B
SQL
21 lines
462 B
SQL
-- name: CreateOrg :one
|
|
INSERT INTO orgs (id, slug, name) VALUES ($1, $2, $3)
|
|
RETURNING *;
|
|
|
|
-- name: GetOrg :one
|
|
SELECT * FROM orgs WHERE id = $1;
|
|
|
|
-- name: GetOrgBySlug :one
|
|
SELECT * FROM orgs WHERE slug = $1;
|
|
|
|
-- name: ListOrgs :many
|
|
SELECT * FROM orgs ORDER BY name;
|
|
|
|
-- name: DeleteOrg :execrows
|
|
DELETE FROM orgs WHERE id = $1;
|
|
|
|
-- name: UpdateOrgPolicy :one
|
|
UPDATE orgs SET require_totp = $2, require_sso = $3, updated_at = now()
|
|
WHERE id = $1
|
|
RETURNING *;
|