mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 20:01:02 +00:00
Merge pull request #2527 from nsheridan/master
Don't return extra columns in result set
This commit is contained in:
commit
a527ac7f29
2 changed files with 44 additions and 8 deletions
|
@ -1,10 +1,28 @@
|
|||
-- name: feed-latest-build
|
||||
|
||||
SELECT repo_owner, repo_name, repo_full_name, b.*
|
||||
SELECT
|
||||
repo_owner
|
||||
,repo_name
|
||||
,repo_full_name
|
||||
,build_number
|
||||
,build_event
|
||||
,build_status
|
||||
,build_created
|
||||
,build_started
|
||||
,build_finished
|
||||
,build_commit
|
||||
,build_branch
|
||||
,build_ref
|
||||
,build_refspec
|
||||
,build_remote
|
||||
,build_title
|
||||
,build_message
|
||||
,build_author
|
||||
,build_email
|
||||
,build_avatar
|
||||
FROM repos LEFT OUTER JOIN (
|
||||
SELECT DISTINCT ON (build_repo_id) build_repo_id, build_id, build_number, build_event, build_status, build_created, build_started, build_finished, build_commit, build_branch, build_ref, build_refspec, build_remote, build_title, build_message, build_author, build_email, build_avatar
|
||||
FROM builds
|
||||
ORDER BY build_repo_id, build_id DESC
|
||||
SELECT DISTINCT ON (build_repo_id) * FROM builds
|
||||
ORDER BY build_repo_id, build_id DESC
|
||||
) b ON b.build_repo_id = repos.repo_id
|
||||
INNER JOIN perms ON perms.perm_repo_id = repos.repo_id
|
||||
WHERE perms.perm_user_id = $1
|
||||
|
|
|
@ -98,11 +98,29 @@ SELECT currval('builds_build_id_seq');
|
|||
`
|
||||
|
||||
var feedLatestBuild = `
|
||||
SELECT repo_owner, repo_name, repo_full_name, b.*
|
||||
SELECT
|
||||
repo_owner
|
||||
,repo_name
|
||||
,repo_full_name
|
||||
,build_number
|
||||
,build_event
|
||||
,build_status
|
||||
,build_created
|
||||
,build_started
|
||||
,build_finished
|
||||
,build_commit
|
||||
,build_branch
|
||||
,build_ref
|
||||
,build_refspec
|
||||
,build_remote
|
||||
,build_title
|
||||
,build_message
|
||||
,build_author
|
||||
,build_email
|
||||
,build_avatar
|
||||
FROM repos LEFT OUTER JOIN (
|
||||
SELECT DISTINCT ON (build_repo_id) build_repo_id, build_id, build_number, build_event, build_status, build_created, build_started, build_finished, build_commit, build_branch, build_ref, build_refspec, build_remote, build_title, build_message, build_author, build_email, build_avatar
|
||||
FROM builds
|
||||
ORDER BY build_repo_id, build_id DESC
|
||||
SELECT DISTINCT ON (build_repo_id) * FROM builds
|
||||
ORDER BY build_repo_id, build_id DESC
|
||||
) b ON b.build_repo_id = repos.repo_id
|
||||
INNER JOIN perms ON perms.perm_repo_id = repos.repo_id
|
||||
WHERE perms.perm_user_id = $1
|
||||
|
|
Loading…
Reference in a new issue