mirror of
https://github.com/atuinsh/atuin.git
synced 2024-11-22 00:03:49 +01:00
fix: ensure we cleanup all tables when deleting (#2191)
This commit is contained in:
parent
67d64ec4b3
commit
9e36f63c6e
@ -401,24 +401,36 @@ impl Database for Postgres {
|
||||
.await
|
||||
.map_err(fix_error)?;
|
||||
|
||||
sqlx::query("delete from users where id = $1")
|
||||
.bind(u.id)
|
||||
.execute(&self.pool)
|
||||
.await
|
||||
.map_err(fix_error)?;
|
||||
|
||||
sqlx::query("delete from history where user_id = $1")
|
||||
.bind(u.id)
|
||||
.execute(&self.pool)
|
||||
.await
|
||||
.map_err(fix_error)?;
|
||||
|
||||
sqlx::query("delete from store where user_id = $1")
|
||||
.bind(u.id)
|
||||
.execute(&self.pool)
|
||||
.await
|
||||
.map_err(fix_error)?;
|
||||
|
||||
sqlx::query("delete from user_verification_token where user_id = $1")
|
||||
.bind(u.id)
|
||||
.execute(&self.pool)
|
||||
.await
|
||||
.map_err(fix_error)?;
|
||||
|
||||
sqlx::query("delete from total_history_count_user where user_id = $1")
|
||||
.bind(u.id)
|
||||
.execute(&self.pool)
|
||||
.await
|
||||
.map_err(fix_error)?;
|
||||
|
||||
sqlx::query("delete from users where id = $1")
|
||||
.bind(u.id)
|
||||
.execute(&self.pool)
|
||||
.await
|
||||
.map_err(fix_error)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user