Update the username as well in the upsert case

This commit is contained in:
Natsu Kagami 2024-02-05 00:20:35 +01:00
parent de06c8e37f
commit 96961ed731
Signed by: nki
GPG key ID: 55A032EB38B49ADB
2 changed files with 3 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{
"db_name": "SQLite",
"query": "INSERT\n INTO osu_users(user_id, username, id, last_update, pp_std, pp_taiko, pp_mania, pp_catch, failures)\n VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)\n ON CONFLICT (user_id) WHERE id = ? DO UPDATE\n SET\n last_update = excluded.last_update,\n pp_std = excluded.pp_std,\n pp_taiko = excluded.pp_taiko,\n pp_mania = excluded.pp_mania,\n pp_catch = excluded.pp_catch,\n failures = excluded.failures\n ",
"query": "INSERT\n INTO osu_users(user_id, username, id, last_update, pp_std, pp_taiko, pp_mania, pp_catch, failures)\n VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)\n ON CONFLICT (user_id) WHERE id = ? DO UPDATE\n SET\n last_update = excluded.last_update,\n username = excluded.username,\n pp_std = excluded.pp_std,\n pp_taiko = excluded.pp_taiko,\n pp_mania = excluded.pp_mania,\n pp_catch = excluded.pp_catch,\n failures = excluded.failures\n ",
"describe": {
"columns": [],
"parameters": {
@ -8,5 +8,5 @@
},
"nullable": []
},
"hash": "e17f70eb4375790907c7ecec1132cab859a7a18a8ce636f0b39c0b5387d9dffc"
"hash": "26a910506c0613936be169df13320dfd7f9d3df62a35ba63c61efc5de70e750d"
}

View file

@ -95,6 +95,7 @@ impl OsuUser {
ON CONFLICT (user_id) WHERE id = ? DO UPDATE
SET
last_update = excluded.last_update,
username = excluded.username,
pp_std = excluded.pp_std,
pp_taiko = excluded.pp_taiko,
pp_mania = excluded.pp_mania,