4ccb980593
Initial Job Collector (changes pending) * movearroundtocleancollector * internalgetfunctions * completecollectorquery * simplify * fixtests * addvendor * noplaceholder
9 lines
504 B
SQL
9 lines
504 B
SQL
CREATE VIEW fullActiveCollectors AS
|
|
SELECT DISTINCT c.id, c.jobId, c.minCleanVersion, c.minTextVersion, c.activeVersion, c.latestVersion,
|
|
jsonb_object_agg(q.name, q.queryId) FILTER (WHERE q.name is not null) AS fields
|
|
FROM collectors AS c
|
|
LEFT JOIN collectorQueries AS q ON c.id = q.collectorId
|
|
AND c.activeVersion >= q.addedVersion
|
|
and c.activeVersion < COALESCE(q.removedVersion, c.activeVersion + 1)
|
|
GROUP BY c.id, c.jobId, c.minCleanVersion, c.minTextVersion;
|