Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
fix: create user with avatar url for sqlite
Steven1f79ee575b7a
diff --git a/store/db/postgres/user.go b/store/db/postgres/user.goindex 2bdf6f16b..807b89559 100644--- a/store/db/postgres/user.go+++ b/store/db/postgres/user.go@@ -11,10 +11,9 @@ import (func (d *DB) CreateUser(ctx context.Context, create *store.User) (*store.User, error) {fields := []string{"username", "role", "email", "nickname", "password_hash", "avatar_url"}args := []any{create.Username, create.Role, create.Email, create.Nickname, create.PasswordHash, create.AvatarURL}- stmt := "INSERT INTO \"user\" (" + strings.Join(fields, ", ") + ") VALUES (" + placeholders(len(args)) + ") RETURNING id, avatar_url, description, created_ts, updated_ts, row_status"+ stmt := "INSERT INTO \"user\" (" + strings.Join(fields, ", ") + ") VALUES (" + placeholders(len(args)) + ") RETURNING id, description, created_ts, updated_ts, row_status"if err := d.db.QueryRowContext(ctx, stmt, args...).Scan(&create.ID,- &create.AvatarURL,&create.Description,&create.CreatedTs,&create.UpdatedTs,diff --git a/store/db/sqlite/user.go b/store/db/sqlite/user.goindex 6c885fd7d..c07ef4a67 100644--- a/store/db/sqlite/user.go+++ b/store/db/sqlite/user.go@@ -9,13 +9,12 @@ import ()func (d *DB) CreateUser(ctx context.Context, create *store.User) (*store.User, error) {- fields := []string{"`username`", "`role`", "`email`", "`nickname`", "`password_hash`"}- placeholder := []string{"?", "?", "?", "?", "?"}- args := []any{create.Username, create.Role, create.Email, create.Nickname, create.PasswordHash}- stmt := "INSERT INTO user (" + strings.Join(fields, ", ") + ") VALUES (" + strings.Join(placeholder, ", ") + ") RETURNING id, avatar_url, description, created_ts, updated_ts, row_status"+ fields := []string{"`username`", "`role`", "`email`", "`nickname`", "`password_hash`, `avatar_url`"}+ placeholder := []string{"?", "?", "?", "?", "?", "?"}+ args := []any{create.Username, create.Role, create.Email, create.Nickname, create.PasswordHash, create.AvatarURL}+ stmt := "INSERT INTO user (" + strings.Join(fields, ", ") + ") VALUES (" + strings.Join(placeholder, ", ") + ") RETURNING id, description, created_ts, updated_ts, row_status"if err := d.db.QueryRowContext(ctx, stmt, args...).Scan(&create.ID,- &create.AvatarURL,&create.Description,&create.CreatedTs,&create.UpdatedTs,