Skip to content

Commit

Permalink
fix: use correct empty uuids (#4917)
Browse files Browse the repository at this point in the history
  • Loading branch information
coadler committed Nov 6, 2022
1 parent 1898f67 commit 65ffa20
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions coderd/database/queries.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions coderd/database/queries/auditlogs.sql
Expand Up @@ -22,7 +22,7 @@ WHERE
END
-- Filter resource_id
AND CASE
WHEN @resource_id :: uuid != '00000000-00000000-00000000-00000000' THEN
WHEN @resource_id :: uuid != '00000000-0000-0000-0000-000000000000'::uuid THEN
resource_id = @resource_id
ELSE true
END
Expand Down Expand Up @@ -83,7 +83,7 @@ WHERE
END
-- Filter resource_id
AND CASE
WHEN @resource_id :: uuid != '00000000-00000000-00000000-00000000' THEN
WHEN @resource_id :: uuid != '00000000-0000-0000-0000-000000000000'::uuid THEN
resource_id = @resource_id
ELSE true
END
Expand Down
2 changes: 1 addition & 1 deletion coderd/database/queries/templates.sql
Expand Up @@ -18,7 +18,7 @@ WHERE
templates.deleted = @deleted
-- Filter by organization_id
AND CASE
WHEN @organization_id :: uuid != '00000000-00000000-00000000-00000000' THEN
WHEN @organization_id :: uuid != '00000000-0000-0000-0000-000000000000'::uuid THEN
organization_id = @organization_id
ELSE true
END
Expand Down
2 changes: 1 addition & 1 deletion coderd/database/queries/templateversions.sql
Expand Up @@ -9,7 +9,7 @@ WHERE
-- This allows using the last element on a page as effectively a cursor.
-- This is an important option for scripts that need to paginate without
-- duplicating or missing data.
WHEN @after_id :: uuid != '00000000-00000000-00000000-00000000' THEN (
WHEN @after_id :: uuid != '00000000-0000-0000-0000-000000000000'::uuid THEN (
-- The pagination cursor is the last ID of the previous page.
-- The query is ordered by the created_at field, so select all
-- rows after the cursor.
Expand Down
2 changes: 1 addition & 1 deletion coderd/database/queries/users.sql
Expand Up @@ -102,7 +102,7 @@ WHERE
-- This allows using the last element on a page as effectively a cursor.
-- This is an important option for scripts that need to paginate without
-- duplicating or missing data.
WHEN @after_id :: uuid != '00000000-00000000-00000000-00000000' THEN (
WHEN @after_id :: uuid != '00000000-0000-0000-0000-000000000000'::uuid THEN (
-- The pagination cursor is the last ID of the previous page.
-- The query is ordered by the created_at field, so select all
-- rows after the cursor.
Expand Down
2 changes: 1 addition & 1 deletion coderd/database/queries/workspacebuilds.sql
Expand Up @@ -42,7 +42,7 @@ WHERE
-- This allows using the last element on a page as effectively a cursor.
-- This is an important option for scripts that need to paginate without
-- duplicating or missing data.
WHEN @after_id :: uuid != '00000000-00000000-00000000-00000000' THEN (
WHEN @after_id :: uuid != '00000000-0000-0000-0000-000000000000'::uuid THEN (
-- The pagination cursor is the last ID of the previous page.
-- The query is ordered by the build_number field, so select all
-- rows after the cursor.
Expand Down
4 changes: 2 additions & 2 deletions coderd/database/queries/workspaces.sql
Expand Up @@ -102,7 +102,7 @@ WHERE
END
-- Filter by owner_id
AND CASE
WHEN @owner_id :: uuid != '00000000-00000000-00000000-00000000' THEN
WHEN @owner_id :: uuid != '00000000-0000-0000-0000-000000000000'::uuid THEN
owner_id = @owner_id
ELSE true
END
Expand Down Expand Up @@ -240,7 +240,7 @@ WHERE
END
-- Filter by owner_id
AND CASE
WHEN @owner_id :: uuid != '00000000-00000000-00000000-00000000' THEN
WHEN @owner_id :: uuid != '00000000-0000-0000-0000-000000000000'::uuid THEN
owner_id = @owner_id
ELSE true
END
Expand Down

0 comments on commit 65ffa20

Please sign in to comment.