Sha256: 02cffacac7ee9d80ce31fe579826b78cc96578a050152d4fc0d02556777640da

Contents?: true

Size: 828 Bytes

Versions: 75

Compression:

Stored size: 828 Bytes

Contents

-- Deletes all verifications and pact publications that are older than 60 days,
-- and cleans up orphan pacticipant versions and their tags.
-- Also removes webhook execution history.

DELETE FROM webhook_executions;
DELETE FROM triggered_webhooks;
DELETE FROM verifications WHERE created_at < now() - '60 days'::interval;
DELETE FROM pact_publications WHERE created_at < now() - '60 days'::interval;
DELETE FROM pact_versions WHERE id NOT IN (SELECT pact_version_id FROM pact_publications UNION SELECT pact_version_id FROM verifications);
DELETE FROM tags WHERE version_id NOT IN (SELECT consumer_version_id FROM pact_publications UNION SELECT provider_version_id FROM verifications);
DELETE FROM versions WHERE id NOT IN (SELECT consumer_version_id FROM pact_publications UNION SELECT provider_version_id FROM verifications);

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
pact_broker-2.89.1 script/prod/clean-up.sql
pact_broker-2.89.0 script/prod/clean-up.sql
pact_broker-2.88.0 script/prod/clean-up.sql
pact_broker-2.87.0 script/prod/clean-up.sql
pact_broker-2.86.0 script/prod/clean-up.sql
pact_broker-2.85.1 script/prod/clean-up.sql
pact_broker-2.85.0 script/prod/clean-up.sql
pact_broker-2.84.0 script/prod/clean-up.sql
pact_broker-2.83.0 script/prod/clean-up.sql
pact_broker-2.82.0 script/prod/clean-up.sql
pact_broker-2.81.0 script/prod/clean-up.sql
pact_broker-2.80.0 script/prod/clean-up.sql
pact_broker-2.79.1 script/prod/clean-up.sql
pact_broker-2.79.0 script/prod/clean-up.sql
pact_broker-2.78.1 script/prod/clean-up.sql
pact_broker-2.78.0 script/prod/clean-up.sql
pact_broker-2.77.0 script/prod/clean-up.sql
pact_broker-2.76.2 script/prod/clean-up.sql
pact_broker-2.76.1 script/prod/clean-up.sql
pact_broker-2.76.0 script/prod/clean-up.sql