mirror of
https://github.com/atuinsh/atuin.git
synced 2025-06-26 12:51:35 +02: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
|
.await
|
||||||
.map_err(fix_error)?;
|
.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")
|
sqlx::query("delete from history where user_id = $1")
|
||||||
.bind(u.id)
|
.bind(u.id)
|
||||||
.execute(&self.pool)
|
.execute(&self.pool)
|
||||||
.await
|
.await
|
||||||
.map_err(fix_error)?;
|
.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")
|
sqlx::query("delete from total_history_count_user where user_id = $1")
|
||||||
.bind(u.id)
|
.bind(u.id)
|
||||||
.execute(&self.pool)
|
.execute(&self.pool)
|
||||||
.await
|
.await
|
||||||
.map_err(fix_error)?;
|
.map_err(fix_error)?;
|
||||||
|
|
||||||
|
sqlx::query("delete from users where id = $1")
|
||||||
|
.bind(u.id)
|
||||||
|
.execute(&self.pool)
|
||||||
|
.await
|
||||||
|
.map_err(fix_error)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user