Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit70ecdcc

Browse files
dannykoppingSasSwart
authored andcommitted
Simplify workspace_latest_build view
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
1 parentad9a2c5 commit70ecdcc

File tree

2 files changed

+20
-33
lines changed

2 files changed

+20
-33
lines changed

‎coderd/database/dump.sql

Lines changed: 17 additions & 22 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/migrations/000302_prebuilds.up.sql

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
CREATEVIEWworkspace_latest_buildAS
2-
SELECT wb.*
3-
FROM (SELECTtv.template_id,
4-
wbmax.workspace_id,
5-
MAX(wbmax.build_number)as max_build_number
6-
FROM workspace_builds wbmax
7-
JOIN template_versions tvON (tv.id=wbmax.template_version_id)
8-
GROUP BYtv.template_id,wbmax.workspace_id) wbmax
9-
JOIN workspace_builds wbON (
10-
wb.workspace_id=wbmax.workspace_id
11-
ANDwb.build_number=wbmax.max_build_number
12-
);
2+
SELECT DISTINCTON (workspace_id)*
3+
FROM workspace_builds
4+
ORDER BY workspace_id, build_numberDESC;
135

146
CREATEVIEWworkspace_prebuildsAS
157
WITH

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp