Skip to content

Commit

Permalink
Update query
Browse files Browse the repository at this point in the history
  • Loading branch information
eashaw committed Jul 3, 2024
1 parent f92460a commit f7389e6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ee/vulnerability-dashboard/scripts/update-reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -906,12 +906,10 @@ module.exports = {

// Check for Vulnerabilities that have no associated Host or VulnerabilityInstall records.
let nativeQueryToFindVulnsWithNoAssociatedRecords =
`SELECT id
FROM vulnerability
WHERE id NOT IN (
SELECT vulnerability
FROM vulnerabilityinstall
);`;
`SELECT v.id
FROM vulnerability v
LEFT JOIN vulnerabilityinstall vi ON v.id = vi.vulnerability
WHERE vi.vulnerability IS NULL;`;
let rawResultFromDatabase = await sails.sendNativeQuery(nativeQueryToFindVulnsWithNoAssociatedRecords);
let vulnerabilityRecordIdsWithNoAssociatedRecords = rawResultFromDatabase.rows;

Expand Down

0 comments on commit f7389e6

Please sign in to comment.