fix: make username updates case insensitive

This commit is contained in:
Gabe Farrell 2025-07-05 21:44:15 -04:00
parent cdb091af3f
commit 0042e3f3bd
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,3 @@
-- +goose Up
UPDATE users
SET username = LOWER(username);

View file

@ -120,7 +120,7 @@ func (d *Psql) UpdateUser(ctx context.Context, opts db.UpdateUserOpts) error {
}
err = qtx.UpdateUserUsername(ctx, repository.UpdateUserUsernameParams{
ID: opts.ID,
Username: opts.Username,
Username: strings.ToLower(opts.Username),
})
if err != nil {
return fmt.Errorf("UpdateUser: UpdateUserUsername: %w", err)