mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
feat: Add GET previous template version endpoint (#5230)
This commit is contained in:
@ -110,3 +110,17 @@ SET
|
||||
updated_at = $3
|
||||
WHERE
|
||||
job_id = $1;
|
||||
|
||||
-- name: GetPreviousTemplateVersion :one
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
template_versions
|
||||
WHERE
|
||||
created_at < (
|
||||
SELECT created_at
|
||||
FROM template_versions AS tv
|
||||
WHERE tv.organization_id = $1 AND tv.name = $2 AND tv.template_id = $3
|
||||
)
|
||||
ORDER BY created_at DESC
|
||||
LIMIT 1;
|
||||
|
Reference in New Issue
Block a user