Files
libredesk/internal/team/queries.sql
T
2024-06-16 02:27:41 +05:30

14 lines
343 B
SQL

-- name: get-teams
SELECT id, name, uuid from teams where disabled is not true;
-- name: get-team
SELECT name, uuid from teams where disabled is not true and uuid = $1;
-- name: get-team-members
SELECT u.id, u.uuid, t.id as team_id
FROM users u
JOIN team_members tm ON tm.user_id = u.id
JOIN teams t ON t.id = tm.team_id
WHERE t.name = $1;