From ca5348dd6c23fccf67402d43677fed866f66f683 Mon Sep 17 00:00:00 2001 From: Ashutosh singh <55102089+Ashutosh619-sudo@users.noreply.github.com> Date: Thu, 30 Nov 2023 02:16:11 -0800 Subject: [PATCH] delete last export details in reset workspace function (#469) --- scripts/sql/functions/delete-workspace.sql | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/sql/functions/delete-workspace.sql b/scripts/sql/functions/delete-workspace.sql index ac369133..d5736c9a 100644 --- a/scripts/sql/functions/delete-workspace.sql +++ b/scripts/sql/functions/delete-workspace.sql @@ -217,6 +217,12 @@ BEGIN GET DIAGNOSTICS rcount = ROW_COUNT; RAISE NOTICE 'Deleted % workspace_schedules', rcount; + DELETE + FROM last_export_details led + WHERE led.workspace_id = _workspace_id; + GET DIAGNOSTICS rcount = ROW_COUNT; + RAISE NOTICE 'Deleted % last_export_details', rcount; + DELETE FROM django_q_schedule dqs WHERE dqs.args = _workspace_id::varchar(255); @@ -267,4 +273,4 @@ BEGIN RETURN; END -$$ LANGUAGE plpgsql; \ No newline at end of file +$$ LANGUAGE plpgsql;