Skip to content

Commit 01fb30c

Browse files
committed
change sql to use is_default vs first org
1 parent c11cfbc commit 01fb30c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

coderd/coderd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ func (api *API) CreateInMemoryProvisionerDaemon(dialCtx context.Context, name st
12391239
}
12401240
}()
12411241

1242-
// All in memory provisioners will be apart of the default org for now.
1242+
// All in memory provisioners will be part of the default org for now.
12431243
//nolint:gocritic // in-memory provisioners are owned by system
12441244
defaultOrg, err := api.Database.GetDefaultOrganization(dbauthz.AsSystemRestricted(dialCtx))
12451245
if err != nil {

coderd/database/migrations/000198_org_provisioners.up.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ UPDATE
88
provisioner_daemons
99
SET
1010
-- Default to the first org
11-
organization_id = (SELECT id FROM organizations ORDER BY organizations.created_at ASC LIMIT 1 );
11+
organization_id = (SELECT id FROM organizations WHERE is_default = true LIMIT 1 );
1212

1313
ALTER TABLE provisioner_daemons
1414
ALTER COLUMN organization_id SET NOT NULL;

0 commit comments

Comments
 (0)