From 4957f6804ce4843649bd70d270c4973686e86361 Mon Sep 17 00:00:00 2001 From: Viswas Haridas <37623357+JustARatherRidiculouslyLongUsername@users.noreply.github.com> Date: Sat, 14 Dec 2024 01:00:43 +0530 Subject: [PATCH] fix: delete `expense_attributes_deletion_cache` in workspace reset (#685) --- scripts/sql/functions/reset-workspace.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/sql/functions/reset-workspace.sql b/scripts/sql/functions/reset-workspace.sql index d1afff02..c3d5c0db 100644 --- a/scripts/sql/functions/reset-workspace.sql +++ b/scripts/sql/functions/reset-workspace.sql @@ -253,6 +253,12 @@ BEGIN -- GET DIAGNOSTICS rcount = ROW_COUNT; -- RAISE NOTICE 'Deleted % workspaces', rcount; + DELETE + FROM expense_attributes_deletion_cache + WHERE workspace_id = _workspace_id; + GET DIAGNOSTICS rcount = ROW_COUNT; + RAISE NOTICE 'Deleted % expense_attributes_deletion_cache', rcount; + UPDATE workspaces SET last_synced_at = null, ns_account_id = '' WHERE id = _workspace_id;