diff --git a/cli/testdata/coder_list_--output_json.golden b/cli/testdata/coder_list_--output_json.golden index c65c1cd61db80..8f45fd79cfd5a 100644 --- a/cli/testdata/coder_list_--output_json.golden +++ b/cli/testdata/coder_list_--output_json.golden @@ -7,7 +7,7 @@ "owner_name": "testuser", "owner_avatar_url": "", "organization_id": "[first org ID]", - "organization_name": "first-organization", + "organization_name": "coder", "template_id": "[template ID]", "template_name": "test-template", "template_display_name": "", diff --git a/coderd/database/dbmem/dbmem.go b/coderd/database/dbmem/dbmem.go index dbf8e5514ea2e..6500fb32784ba 100644 --- a/coderd/database/dbmem/dbmem.go +++ b/coderd/database/dbmem/dbmem.go @@ -92,8 +92,8 @@ func New() database.Store { // Always start with a default org. Matching migration 198. defaultOrg, err := q.InsertOrganization(context.Background(), database.InsertOrganizationParams{ ID: uuid.New(), - Name: "first-organization", - DisplayName: "first-organization", + Name: "coder", + DisplayName: "Coder", Description: "Builtin default organization.", Icon: "", CreatedAt: dbtime.Now(), diff --git a/coderd/database/migrations/000259_rename_first_organization.down.sql b/coderd/database/migrations/000259_rename_first_organization.down.sql new file mode 100644 index 0000000000000..e76e68e8b8174 --- /dev/null +++ b/coderd/database/migrations/000259_rename_first_organization.down.sql @@ -0,0 +1,3 @@ +-- Leave the name as 'coder', there is no downside. +-- The old name 'first-organization' is not used anywhere, just the +-- is_default property. diff --git a/coderd/database/migrations/000259_rename_first_organization.up.sql b/coderd/database/migrations/000259_rename_first_organization.up.sql new file mode 100644 index 0000000000000..84bd45373cd8d --- /dev/null +++ b/coderd/database/migrations/000259_rename_first_organization.up.sql @@ -0,0 +1,10 @@ +UPDATE + organizations +SET + name = 'coder', + display_name = 'Coder' +WHERE + -- The old name was too long. + name = 'first-organization' + AND is_default = true +; diff --git a/enterprise/cli/create_test.go b/enterprise/cli/create_test.go index 33423e366a538..1c0804e4d92eb 100644 --- a/enterprise/cli/create_test.go +++ b/enterprise/cli/create_test.go @@ -202,6 +202,6 @@ func TestEnterpriseCreate(t *testing.T) { err := inv.Run() require.Error(t, err) // The error message should indicate the flag to fix the issue. - require.ErrorContains(t, err, fmt.Sprintf("--org=%q", "first-organization")) + require.ErrorContains(t, err, fmt.Sprintf("--org=%q", "coder")) }) }