-- name: ListTargetsOfSite :many
SELECT * FROM publish_targets WHERE site_id = $1;

-- name: GetTargetOfSiteRole :one
SELECT * FROM publish_targets WHERE site_id = $1 AND role = $2 LIMIT 1;

-- name: InsertPublishTarget :one
INSERT INTO publish_targets (
    site_id,
    role,
    target_type,
    url,
    target_ref
) VALUES ($1, $2, $3, $4, $5)
RETURNING id;