mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
fix: workspaces query to correctly user username from users table (#15305)
The subquery on the users table was incorrectly using the username from the `workspaces` table, not the `users` table. This passed `sqlc-vet` because the column did exist in the query, it just was not the correct one.
This commit is contained in:
@ -233,7 +233,7 @@ WHERE
|
||||
-- Filter by owner_name
|
||||
AND CASE
|
||||
WHEN @owner_username :: text != '' THEN
|
||||
workspaces.owner_id = (SELECT id FROM users WHERE lower(owner_username) = lower(@owner_username) AND deleted = false)
|
||||
workspaces.owner_id = (SELECT id FROM users WHERE lower(users.username) = lower(@owner_username) AND deleted = false)
|
||||
ELSE true
|
||||
END
|
||||
-- Filter by template_name
|
||||
|
Reference in New Issue
Block a user