Skip to content

Commit 0f27fcc

Browse files
committed
Slightly more optimized query
1 parent a6baf6b commit 0f27fcc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

coderd/database/queries.sql.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/organizations.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ INSERT INTO
4242
organizations (id, "name", description, created_at, updated_at, is_default)
4343
VALUES
4444
-- If no organizations exist, and this is the first, make it the default.
45-
($1, $2, $3, $4, $5, (SELECT count(*) FROM organizations) = 0) RETURNING *;
45+
($1, $2, $3, $4, $5, (SELECT TRUE FROM organizations LIMIT 1) IS NULL) RETURNING *;

0 commit comments

Comments
 (0)