Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: edit org display names and descriptions#13474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
aslilac merged 8 commits intomainfromorg-display-name
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletionscoderd/apidoc/docs.go
View file
Open in desktop

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

29 changes: 27 additions & 2 deletionscoderd/apidoc/swagger.json
View file
Open in desktop

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

1 change: 1 addition & 0 deletionscoderd/database/dbgen/dbgen.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -336,6 +336,7 @@ func Organization(t testing.TB, db database.Store, orig database.Organization) d
org, err := db.InsertOrganization(genCtx, database.InsertOrganizationParams{
ID: takeFirst(orig.ID, uuid.New()),
Name: takeFirst(orig.Name, namesgenerator.GetRandomName(1)),
DisplayName: takeFirst(orig.Name, namesgenerator.GetRandomName(1)),
Description: takeFirst(orig.Description, namesgenerator.GetRandomName(1)),
CreatedAt: takeFirst(orig.CreatedAt, dbtime.Now()),
UpdatedAt: takeFirst(orig.UpdatedAt, dbtime.Now()),
Expand Down
15 changes: 10 additions & 5 deletionscoderd/database/dbmem/dbmem.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,6 +86,7 @@ func New() database.Store {
defaultOrg, err := q.InsertOrganization(context.Background(), database.InsertOrganizationParams{
ID: uuid.New(),
Name: "first-organization",
DisplayName: "first-organization",
Description: "Builtin default organization.",
CreatedAt: dbtime.Now(),
UpdatedAt: dbtime.Now(),
Expand DownExpand Up@@ -6177,11 +6178,13 @@ func (q *FakeQuerier) InsertOrganization(_ context.Context, arg database.InsertO
defer q.mutex.Unlock()

organization := database.Organization{
ID: arg.ID,
Name: arg.Name,
CreatedAt: arg.CreatedAt,
UpdatedAt: arg.UpdatedAt,
IsDefault: len(q.organizations) == 0,
ID: arg.ID,
Name: arg.Name,
DisplayName: arg.DisplayName,
Description: arg.Description,
CreatedAt: arg.CreatedAt,
UpdatedAt: arg.UpdatedAt,
IsDefault: len(q.organizations) == 0,
}
q.organizations = append(q.organizations, organization)
return organization, nil
Expand DownExpand Up@@ -7322,6 +7325,8 @@ func (q *FakeQuerier) UpdateOrganization(_ context.Context, arg database.UpdateO
for i, org := range q.organizations {
if org.ID == arg.ID {
org.Name = arg.Name
org.DisplayName = arg.DisplayName
org.Description = arg.Description
q.organizations[i] = org
return org, nil
}
Expand Down
3 changes: 2 additions & 1 deletioncoderd/database/dump.sql
View file
Open in desktop

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

View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
alter table organizations
drop column display_name;
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
-- This default is just a temporary thing to avoid null errors when first creating the column.
alter table organizations
add column display_name text not null default '';

update organizations
set display_name = name;

-- We can remove the default now that everything has been copied.
alter table organizations
alter column display_name drop default;
1 change: 1 addition & 0 deletionscoderd/database/models.go
View file
Open in desktop

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

47 changes: 33 additions & 14 deletionscoderd/database/queries.sql.go
View file
Open in desktop

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

8 changes: 5 additions & 3 deletionscoderd/database/queries/organizations.sql
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -49,17 +49,19 @@ WHERE

-- name: InsertOrganization :one
INSERT INTO
organizations (id, "name", description, created_at, updated_at, is_default)
organizations (id, "name",display_name,description, created_at, updated_at, is_default)
VALUES
-- If no organizations exist, and this is the first, make it the default.
($1, $2, $3, $4, $5, (SELECT TRUE FROM organizations LIMIT 1) IS NULL) RETURNING *;
(@id, @name, @display_name, @description, @created_at, @updated_at, (SELECT TRUE FROM organizations LIMIT 1) IS NULL) RETURNING *;

-- name: UpdateOrganization :one
UPDATE
organizations
SET
updated_at = @updated_at,
name = @name
name = @name,
display_name = @display_name,
description = @description
WHERE
id = @id
RETURNING *;
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp