feat(backend): remove avatar_source field, change avatar_urls on member

This commit is contained in:
Sam 2022-09-20 14:12:29 +02:00
parent 5679dbb657
commit 85a061ebc5
4 changed files with 32 additions and 34 deletions

View File

@ -14,7 +14,7 @@ type Member struct {
UserID xid.ID
Name string
Bio *string
AvatarURL *string
AvatarURLs []string `db:"avatar_urls"`
Links []string
}

View File

@ -18,7 +18,6 @@ type User struct {
DisplayName *string
Bio *string
AvatarSource *string
AvatarURLs []string `db:"avatar_urls"`
Links []string

View File

@ -15,7 +15,7 @@ type GetMemberResponse struct {
ID xid.ID `json:"id"`
Name string `json:"name"`
Bio *string `json:"bio"`
AvatarURL *string `json:"avatar_url"`
AvatarURLs []string `json:"avatar_urls"`
Links []string `json:"links"`
Names []db.Name `json:"names"`
@ -30,7 +30,7 @@ func dbMemberToMember(u db.User, m db.Member, names []db.Name, pronouns []db.Pro
ID: m.ID,
Name: m.Name,
Bio: m.Bio,
AvatarURL: m.AvatarURL,
AvatarURLs: m.AvatarURLs,
Links: m.Links,
Names: names,

View File

@ -8,7 +8,6 @@ create table users (
display_name text,
bio text,
avatar_source text,
avatar_urls text[],
links text[],
@ -36,11 +35,11 @@ create table user_fields (
id bigserial primary key,
name text not null,
favourite text[] not null default array[]::text[],
okay text[] not null default array[]::text[],
jokingly text[] not null default array[]::text[],
friends_only text[] not null default array[]::text[],
avoid text[] not null default array[]::text[]
favourite text[],
okay text[],
jokingly text[],
friends_only text[],
avoid text[]
);
create table members (
@ -49,7 +48,7 @@ create table members (
name text not null,
bio text,
avatar_url text,
avatar_urls text[],
links text[]
);
@ -73,9 +72,9 @@ create table member_fields (
id bigserial primary key,
name text not null,
favourite text[] not null default array[]::text[],
okay text[] not null default array[]::text[],
jokingly text[] not null default array[]::text[],
friends_only text[] not null default array[]::text[],
avoid text[] not null default array[]::text[]
favourite text[],
okay text[],
jokingly text[],
friends_only text[],
avoid text[]
);