mirror of
https://github.com/gabehf/Koito.git
synced 2026-04-22 12:01:52 -07:00
fix: make username updates case insensitive
This commit is contained in:
parent
cdb091af3f
commit
0042e3f3bd
2 changed files with 4 additions and 1 deletions
3
db/migrations/000004_fix_usernames.sql
Normal file
3
db/migrations/000004_fix_usernames.sql
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
-- +goose Up
|
||||
UPDATE users
|
||||
SET username = LOWER(username);
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue