From 5d26d3f47a0131185fc17e5d95d28f47ebb5be35 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Fri, 14 Jul 2023 20:45:10 +0100 Subject: [PATCH] Delete the count cache row when a user is deleted (#1103) --- atuin-server-postgres/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/atuin-server-postgres/src/lib.rs b/atuin-server-postgres/src/lib.rs index fe1363a..3b001bb 100644 --- a/atuin-server-postgres/src/lib.rs +++ b/atuin-server-postgres/src/lib.rs @@ -277,6 +277,12 @@ impl Database for Postgres { .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)?; + Ok(()) }