Skip to content

Commit 4a34d52

Browse files
refactor: remove * usage from prebuilds.sql queries
1 parent 4cfdd6f commit 4a34d52

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

coderd/database/queries.sql.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/prebuilds.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ GROUP BY t.id, wpb.template_version_id, wpb.transition;
6060
-- name: GetPresetsBackoff :many
6161
WITH filtered_builds AS (
6262
-- Only select builds which are for prebuild creations
63-
SELECT wlb.*, tvp.id AS preset_id, pj.job_status, tvp.desired_instances
63+
SELECT wlb.template_version_id, wlb.created_at, tvp.id AS preset_id, pj.job_status, tvp.desired_instances
6464
FROM template_version_presets tvp
6565
INNER JOIN workspace_latest_builds wlb ON wlb.template_version_preset_id = tvp.id
6666
INNER JOIN provisioner_jobs pj ON wlb.job_id = pj.id
@@ -71,8 +71,8 @@ WITH filtered_builds AS (
7171
),
7272
time_sorted_builds AS (
7373
-- Group builds by template version, then sort each group by created_at.
74-
SELECT fb.*,
75-
ROW_NUMBER() OVER (PARTITION BY fb.template_version_preset_id ORDER BY fb.created_at DESC) as rn
74+
SELECT fb.template_version_id, fb.created_at, fb.preset_id, fb.job_status, fb.desired_instances,
75+
ROW_NUMBER() OVER (PARTITION BY fb.preset_id ORDER BY fb.created_at DESC) as rn
7676
FROM filtered_builds fb
7777
),
7878
failed_count AS (

0 commit comments

Comments
 (0)