diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2023-07-14 20:45:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-14 20:45:10 +0100 |
| commit | 5d26d3f47a0131185fc17e5d95d28f47ebb5be35 (patch) | |
| tree | 6c3ae27fde51bffbfb7ee10e59b8b028b121ae1b /atuin-server-postgres/src/lib.rs | |
| parent | Add total history count to the index API (#1102) (diff) | |
| download | atuin-5d26d3f47a0131185fc17e5d95d28f47ebb5be35.zip | |
Delete the count cache row when a user is deleted (#1103)
Diffstat (limited to 'atuin-server-postgres/src/lib.rs')
| -rw-r--r-- | atuin-server-postgres/src/lib.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/atuin-server-postgres/src/lib.rs b/atuin-server-postgres/src/lib.rs index fe1363ac..3b001bbb 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(()) } |
