File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change
1
+ -- Deletes all verifications and pact publications that are older than 60 days,
2
+ -- and cleans up orphan pacticipant versions and their tags.
3
+ -- Also removes webhook execution history.
4
+
5
+ DELETE FROM verifications WHERE created_at < now() - ' 60 days' ::interval;
6
+ DELETE FROM webhook_executions;
7
+ DELETE FROM triggered_webhooks;
8
+ DELETE FROM pact_publications WHERE created_at < now() - ' 60 days' ::interval;
9
+ DELETE FROM pact_versions WHERE id NOT IN (SELECT distinct pact_version_id from pact_publications);
10
+ DELETE FROM tags WHERE version_id NOT IN (select consumer_version_id from pact_publications union select provider_version_id from verifications);
11
+ DELETE FROM versions WHERE id NOT IN (select consumer_version_id from pact_publications union select provider_version_id from verifications);
You can’t perform that action at this time.
0 commit comments