mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
feat: Add diff and Dockerfile support for template version page (#5339)
This commit is contained in:
@ -1743,6 +1743,13 @@ func (q *fakeQuerier) GetPreviousTemplateVersion(_ context.Context, arg database
|
||||
if templateVersion.ID == currentTemplateVersion.ID {
|
||||
continue
|
||||
}
|
||||
if templateVersion.OrganizationID != arg.OrganizationID {
|
||||
continue
|
||||
}
|
||||
if templateVersion.TemplateID != currentTemplateVersion.TemplateID {
|
||||
continue
|
||||
}
|
||||
|
||||
if templateVersion.CreatedAt.Before(currentTemplateVersion.CreatedAt) {
|
||||
previousTemplateVersions = append(previousTemplateVersions, templateVersion)
|
||||
}
|
||||
|
@ -3532,6 +3532,8 @@ WHERE
|
||||
FROM template_versions AS tv
|
||||
WHERE tv.organization_id = $1 AND tv.name = $2 AND tv.template_id = $3
|
||||
)
|
||||
AND organization_id = $1
|
||||
AND template_id = $3
|
||||
ORDER BY created_at DESC
|
||||
LIMIT 1
|
||||
`
|
||||
|
@ -122,5 +122,7 @@ WHERE
|
||||
FROM template_versions AS tv
|
||||
WHERE tv.organization_id = $1 AND tv.name = $2 AND tv.template_id = $3
|
||||
)
|
||||
AND organization_id = $1
|
||||
AND template_id = $3
|
||||
ORDER BY created_at DESC
|
||||
LIMIT 1;
|
||||
|
Reference in New Issue
Block a user