mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 08:56:29 +00:00
Use join instead of subquery
This commit is contained in:
parent
331af08128
commit
ceae6d5bfe
1 changed files with 6 additions and 7 deletions
|
@ -79,13 +79,12 @@ LIMIT 1;
|
|||
// SQL statement to retrieve a list of Repos
|
||||
// with permissions for the given User ID.
|
||||
const repoListQuery = `
|
||||
SELECT *
|
||||
FROM repos
|
||||
WHERE repo_id IN (
|
||||
SELECT repo_id
|
||||
FROM perms
|
||||
WHERE user_id = ?
|
||||
);
|
||||
SELECT r.*
|
||||
FROM
|
||||
repos r
|
||||
,perms p
|
||||
WHERE r.repo_id = p.repo_id
|
||||
AND p.user_id = ?
|
||||
`
|
||||
|
||||
// SQL statement to delete a User by ID.
|
||||
|
|
Loading…
Reference in a new issue