Update charges rows on user deletion (#5269)
This commit is contained in:
15
apps/labrinth/.sqlx/query-f1f93419f4394c702f256fe3e5de0368ee972ed20bd4d4b2490c655fde999dda.json
generated
Normal file
15
apps/labrinth/.sqlx/query-f1f93419f4394c702f256fe3e5de0368ee972ed20bd4d4b2490c655fde999dda.json
generated
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"db_name": "PostgreSQL",
|
||||||
|
"query": "\n UPDATE charges\n SET user_id = $1\n WHERE user_id = $2\n ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Left": [
|
||||||
|
"Int8",
|
||||||
|
"Int8"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "f1f93419f4394c702f256fe3e5de0368ee972ed20bd4d4b2490c655fde999dda"
|
||||||
|
}
|
||||||
@@ -797,6 +797,18 @@ impl DBUser {
|
|||||||
.execute(&mut *transaction)
|
.execute(&mut *transaction)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
sqlx::query!(
|
||||||
|
"
|
||||||
|
UPDATE charges
|
||||||
|
SET user_id = $1
|
||||||
|
WHERE user_id = $2
|
||||||
|
",
|
||||||
|
deleted_user as DBUserId,
|
||||||
|
id as DBUserId,
|
||||||
|
)
|
||||||
|
.execute(&mut *transaction)
|
||||||
|
.await?;
|
||||||
|
|
||||||
let open_subscriptions =
|
let open_subscriptions =
|
||||||
DBUserSubscription::get_all_user(id, &mut *transaction).await?;
|
DBUserSubscription::get_all_user(id, &mut *transaction).await?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user