mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
fix: allow tag removal in provisioner upsert (#14187)
This commit is contained in:
@ -45,16 +45,13 @@ VALUES (
|
||||
@version,
|
||||
@organization_id,
|
||||
@api_version
|
||||
) ON CONFLICT("name", LOWER(COALESCE(tags ->> 'owner'::text, ''::text))) DO UPDATE SET
|
||||
) ON CONFLICT("organization_id", "name", LOWER(COALESCE(tags ->> 'owner'::text, ''::text))) DO UPDATE SET
|
||||
provisioners = @provisioners,
|
||||
tags = @tags,
|
||||
last_seen_at = @last_seen_at,
|
||||
"version" = @version,
|
||||
api_version = @api_version,
|
||||
organization_id = @organization_id
|
||||
WHERE
|
||||
-- Only ones with the same tags are allowed clobber
|
||||
provisioner_daemons.tags <@ @tags :: jsonb
|
||||
RETURNING *;
|
||||
|
||||
-- name: UpdateProvisionerDaemonLastSeenAt :exec
|
||||
|
Reference in New Issue
Block a user