-- name: user__create_allowed_user :one
INSERT INTO users (email, is_platform_admin)
VALUES (LOWER($1), $2)
ON CONFLICT (email) DO UPDATE
SET is_platform_admin = EXCLUDED.is_platform_admin,
    updated_at = NOW()
RETURNING id, email, COALESCE(github_user_id, 0) AS github_user_id, COALESCE(github_login, '') AS github_login, is_platform_admin, is_platform_owner;
