···260 did text not null,
261262 -- data
0263 description text not null,
264 include_bluesky integer not null default 0,
265 location text,
···1078 // transfer data, constructing pull_at from pulls table
1079 _, err = tx.Exec(`
1080 insert into pull_submissions_new (id, pull_at, round_number, patch, created)
1081- select
1082 ps.id,
1083 'at://' || p.owner_did || '/sh.tangled.repo.pull/' || p.rkey,
1084 ps.round_number,
···11691170 create index if not exists idx_stars_created on stars(created);
1171 create index if not exists idx_stars_subject_at_created on stars(subject_at, created);
00000001172 `)
1173 return err
1174 })
···260 did text not null,
261262 -- data
263+ avatar text,
264 description text not null,
265 include_bluesky integer not null default 0,
266 location text,
···1079 // transfer data, constructing pull_at from pulls table
1080 _, err = tx.Exec(`
1081 insert into pull_submissions_new (id, pull_at, round_number, patch, created)
1082+ select
1083 ps.id,
1084 'at://' || p.owner_did || '/sh.tangled.repo.pull/' || p.rkey,
1085 ps.round_number,
···11701171 create index if not exists idx_stars_created on stars(created);
1172 create index if not exists idx_stars_subject_at_created on stars(subject_at, created);
1173+ `)
1174+ return err
1175+ })
1176+1177+ orm.RunMigration(conn, logger, "add-avatar-to-profile", func(tx *sql.Tx) error {
1178+ _, err := tx.Exec(`
1179+ alter table profile add column avatar text;
1180 `)
1181 return err
1182 })
+10-3
appview/db/profile.go
···128 _, err = tx.Exec(
129 `insert or replace into profile (
130 did,
0131 description,
132 include_bluesky,
133 location,
134 pronouns
135 )
136- values (?, ?, ?, ?, ?)`,
137 profile.Did,
0138 profile.Description,
139 includeBskyValue,
140 profile.Location,
···312func GetProfile(e Execer, did string) (*models.Profile, error) {
313 var profile models.Profile
314 var pronouns sql.Null[string]
0315316 profile.Did = did
317318 includeBluesky := 0
319320 err := e.QueryRow(
321- `select description, include_bluesky, location, pronouns from profile where did = ?`,
322 did,
323- ).Scan(&profile.Description, &includeBluesky, &profile.Location, &pronouns)
324 if err == sql.ErrNoRows {
325 profile := models.Profile{}
326 profile.Did = did
···337338 if pronouns.Valid {
339 profile.Pronouns = pronouns.V
0000340 }
341342 rows, err := e.Query(`select link from profile_links where did = ?`, did)
···128 _, err = tx.Exec(
129 `insert or replace into profile (
130 did,
131+ avatar,
132 description,
133 include_bluesky,
134 location,
135 pronouns
136 )
137+ values (?, ?, ?, ?, ?, ?)`,
138 profile.Did,
139+ profile.Avatar,
140 profile.Description,
141 includeBskyValue,
142 profile.Location,
···314func GetProfile(e Execer, did string) (*models.Profile, error) {
315 var profile models.Profile
316 var pronouns sql.Null[string]
317+ var avatar sql.Null[string]
318319 profile.Did = did
320321 includeBluesky := 0
322323 err := e.QueryRow(
324+ `select avatar, description, include_bluesky, location, pronouns from profile where did = ?`,
325 did,
326+ ).Scan(&avatar, &profile.Description, &includeBluesky, &profile.Location, &pronouns)
327 if err == sql.ErrNoRows {
328 profile := models.Profile{}
329 profile.Did = did
···340341 if pronouns.Valid {
342 profile.Pronouns = pronouns.V
343+ }
344+345+ if avatar.Valid {
346+ profile.Avatar = avatar.V
347 }
348349 rows, err := e.Query(`select link from profile_links where did = ?`, did)
+1
appview/models/profile.go
···13 Did string
1415 // data
016 Description string
17 IncludeBluesky bool
18 Location string
···13 Did string
1415 // data
16+ Avatar string // CID of the avatar blob
17 Description string
18 IncludeBluesky bool
19 Location string