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;