chore: rename 'first-organization' to 'coder' (#14808)

Rename the first-organization original name. Users can change from the
original name.
This commit is contained in:
Steven Masley
2024-09-26 13:20:44 -05:00
committed by GitHub
parent b23e6a05c8
commit 5c977c6be7
5 changed files with 17 additions and 4 deletions

View File

@ -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": "",

View File

@ -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(),

View File

@ -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.

View File

@ -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
;

View File

@ -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"))
})
}