mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-04-26 21:44:44 +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
|
// SQL statement to retrieve a list of Repos
|
||||||
// with permissions for the given User ID.
|
// with permissions for the given User ID.
|
||||||
const repoListQuery = `
|
const repoListQuery = `
|
||||||
SELECT *
|
SELECT r.*
|
||||||
FROM repos
|
FROM
|
||||||
WHERE repo_id IN (
|
repos r
|
||||||
SELECT repo_id
|
,perms p
|
||||||
FROM perms
|
WHERE r.repo_id = p.repo_id
|
||||||
WHERE user_id = ?
|
AND p.user_id = ?
|
||||||
);
|
|
||||||
`
|
`
|
||||||
|
|
||||||
// SQL statement to delete a User by ID.
|
// SQL statement to delete a User by ID.
|
||||||
|
|
Loading…
Reference in a new issue