mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00:00
761dd55ee8
Previously the GetTemplateVersionVariables query did not sort output, relying on PostgreSQL on-disk ordering which is undeterministic. Variables are now sorted by name because there is no alternative for ordering. Tests were adjusted to accommodate the new ordering, previously they relied on data being written to disk in insert order.
27 lines
505 B
SQL
27 lines
505 B
SQL
-- name: InsertTemplateVersionVariable :one
|
|
INSERT INTO
|
|
template_version_variables (
|
|
template_version_id,
|
|
name,
|
|
description,
|
|
type,
|
|
value,
|
|
default_value,
|
|
required,
|
|
sensitive
|
|
)
|
|
VALUES
|
|
(
|
|
$1,
|
|
$2,
|
|
$3,
|
|
$4,
|
|
$5,
|
|
$6,
|
|
$7,
|
|
$8
|
|
) RETURNING *;
|
|
|
|
-- name: GetTemplateVersionVariables :many
|
|
SELECT * FROM template_version_variables WHERE template_version_id = $1 ORDER BY name;
|