feat: Allow inheriting parameters from previous template_versions when updating a template (#2397)

* WIP: feat: Update templates also updates parameters
* Insert params for template version update
* Working implementation of inherited params
* Add "--always-prompt" flag and logging info
This commit is contained in:
Steven Masley
2022-06-17 12:22:28 -05:00
committed by GitHub
parent 18973a65c1
commit 64b92eea67
16 changed files with 547 additions and 167 deletions
+29 -3
View File
@@ -1,17 +1,43 @@
-- name: ParameterValue :one
SELECT * FROM
parameter_values
WHERE
id = $1;
-- name: DeleteParameterValueByID :exec
DELETE FROM
parameter_values
WHERE
id = $1;
-- name: GetParameterValuesByScope :many
-- name: ParameterValues :many
SELECT
*
FROM
parameter_values
WHERE
scope = $1
AND scope_id = $2;
CASE
WHEN cardinality(@scopes :: parameter_scope[]) > 0 THEN
scope = ANY(@scopes :: parameter_scope[])
ELSE true
END
AND CASE
WHEN cardinality(@scope_ids :: uuid[]) > 0 THEN
scope_id = ANY(@scope_ids :: uuid[])
ELSE true
END
AND CASE
WHEN cardinality(@ids :: uuid[]) > 0 THEN
id = ANY(@ids :: uuid[])
ELSE true
END
AND CASE
WHEN cardinality(@names :: text[]) > 0 THEN
"name" = ANY(@names :: text[])
ELSE true
END
;
-- name: GetParameterValueByScopeAndName :one
SELECT