From 89fe7b0819b855f130c44af824804312f6caebf8 Mon Sep 17 00:00:00 2001 From: He Weiwei Date: Mon, 24 Jan 2022 14:05:24 +0800 Subject: [PATCH] Move removing old version scan reports of trivy to 2.4.2 (#16261) Signed-off-by: He Weiwei --- make/migrations/postgresql/0071_2.4.2_schema.up.sql | 2 ++ make/migrations/postgresql/0080_2.5.0_schema.up.sql | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 make/migrations/postgresql/0071_2.4.2_schema.up.sql diff --git a/make/migrations/postgresql/0071_2.4.2_schema.up.sql b/make/migrations/postgresql/0071_2.4.2_schema.up.sql new file mode 100644 index 000000000..df8f5ce98 --- /dev/null +++ b/make/migrations/postgresql/0071_2.4.2_schema.up.sql @@ -0,0 +1,2 @@ +/* Remove old version scan reports of trivy */ +DELETE FROM scan_report WHERE mime_type='application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' AND registration_uuid IN (SELECT uuid FROM scanner_registration WHERE name='Trivy' AND immutable='true'); diff --git a/make/migrations/postgresql/0080_2.5.0_schema.up.sql b/make/migrations/postgresql/0080_2.5.0_schema.up.sql index 3bc70b834..3bac28b94 100644 --- a/make/migrations/postgresql/0080_2.5.0_schema.up.sql +++ b/make/migrations/postgresql/0080_2.5.0_schema.up.sql @@ -21,4 +21,3 @@ CREATE TABLE IF NOT EXISTS artifact_accessory ( CONSTRAINT unique_artifact_accessory UNIQUE (artifact_id, subject_artifact_id) ); -DELETE FROM scan_report WHERE mime_type='application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' AND registration_uuid IN (SELECT uuid FROM scanner_registration WHERE name='Trivy' AND immutable='true');