diff options
Diffstat (limited to 'dbstore/sql')
-rw-r--r-- | dbstore/sql/feed/insert-cve-fts-refresh.sql | 2 | ||||
-rw-r--r-- | dbstore/sql/init.sql | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/dbstore/sql/feed/insert-cve-fts-refresh.sql b/dbstore/sql/feed/insert-cve-fts-refresh.sql new file mode 100644 index 0000000..66cd38a --- /dev/null +++ b/dbstore/sql/feed/insert-cve-fts-refresh.sql @@ -0,0 +1,2 @@ +-- trigger cve_fts_all refresh +INSERT INTO cve_fts_refresh DEFAULT VALUES; diff --git a/dbstore/sql/init.sql b/dbstore/sql/init.sql index d38ca37..a54f278 100644 --- a/dbstore/sql/init.sql +++ b/dbstore/sql/init.sql @@ -387,7 +387,7 @@ CREATE INDEX in_cves_item_id ON cves(item_id); -- CREATE VIEW cve_nvd_ids AS SELECT cve_id, - 'CVE-' || a.cve_year || '-' || printf('%04d', a.cve_num) AS nvd_cve_id + printf('CVE-%04-%04d', cve_year, cve_num) AS nvd_id FROM cves; -- @@ -1225,7 +1225,7 @@ CREATE TRIGGER tr_cve_fts_refresh_after_insert h.cve_ref_id, -- cve_ref_id j.v2_severity_id, -- v2_severity_id l.v3_severity_id, -- v3_severity_id - n.nvd_cve_id, -- nvd_cve_id + n.nvd_id AS nvd_cve_id, -- nvd_cve_id b.assigner, -- assigner COALESCE(d.value, ''), -- cve_desc COALESCE(g.value, ''), -- pt_desc @@ -1261,6 +1261,6 @@ CREATE TRIGGER tr_cve_fts_refresh_after_insert ON (l.item_id = a.item_id) LEFT JOIN severities m ON (m.severity_id = l.v3_severity_id) - JOIN nvd_cve_ids n + JOIN cve_nvd_ids n ON (n.cve_id = a.cve_id); END; |