From 6e7db6bce5c698f0b49f1fc295361d739a06bbfc Mon Sep 17 00:00:00 2001 From: Florian Wilhelm <2292245+fwilhe@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:02:18 +0200 Subject: [PATCH] vector_string --- extra-schema.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/extra-schema.sql b/extra-schema.sql index 894f70e..329468d 100644 --- a/extra-schema.sql +++ b/extra-schema.sql @@ -16,6 +16,17 @@ CREATE OR REPLACE VIEW public.sourcepackagecve (data->'metrics'->'cvssMetricV2'->0->'cvssData'->>'baseScore')::numeric ELSE NULL END AS base_score, + CASE + WHEN data->'metrics'->'cvssMetricV40' IS NOT NULL THEN + (data->'metrics'->'cvssMetricV40'->0->'cvssData'->>'vectorString')::text + WHEN data->'metrics'->'cvssMetricV31' IS NOT NULL THEN + (data->'metrics'->'cvssMetricV31'->0->'cvssData'->>'vectorString')::text + WHEN data->'metrics'->'cvssMetricV30' IS NOT NULL THEN + (data->'metrics'->'cvssMetricV30'->0->'cvssData'->>'vectorString')::text + WHEN data->'metrics'->'cvssMetricV2' IS NOT NULL THEN + (data->'metrics'->'cvssMetricV2'->0->'cvssData'->>'vectorString')::text + ELSE NULL + END AS vector_string, deb_cve.deb_source AS source_package_name, deb_cve.deb_version AS source_package_version, dist_cpe.cpe_version AS gardenlinux_version,