mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(coderd/database): add api_version to provisioner_daemons table (#11204)
Adds column api_version to the provisioner_daemons table. This is distinct from the coderd version, and is used to handle breaking changes in the provisioner daemon API.
This commit is contained in:
@@ -23,7 +23,8 @@ INSERT INTO
|
||||
provisioners,
|
||||
tags,
|
||||
last_seen_at,
|
||||
"version"
|
||||
"version",
|
||||
api_version
|
||||
)
|
||||
VALUES (
|
||||
gen_random_uuid(),
|
||||
@@ -32,12 +33,14 @@ VALUES (
|
||||
@provisioners,
|
||||
@tags,
|
||||
@last_seen_at,
|
||||
@version
|
||||
@version,
|
||||
@api_version
|
||||
) ON CONFLICT("name", lower((tags ->> 'owner'::text))) DO UPDATE SET
|
||||
provisioners = @provisioners,
|
||||
tags = @tags,
|
||||
last_seen_at = @last_seen_at,
|
||||
"version" = @version
|
||||
"version" = @version,
|
||||
api_version = @api_version
|
||||
WHERE
|
||||
-- Only ones with the same tags are allowed clobber
|
||||
provisioner_daemons.tags <@ @tags :: jsonb
|
||||
|
||||
Reference in New Issue
Block a user