Skip to content

Commit

Permalink
chore: add config_analysis_items and config_changes_items with config…
Browse files Browse the repository at this point in the history
… type

Add views that will allow us to filter config insights and changes by type
  • Loading branch information
mainawycliffe committed Feb 9, 2024
1 parent a15a9fc commit 060a5b4
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion views/006_config_views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,20 @@ CREATE OR REPLACE VIEW config_detail AS
ON ci.id = config_changes.config_id
LEFT JOIN
(SELECT config_id, count(*) as playbook_runs_count FROM playbook_runs GROUP BY config_id) as playbook_runs
ON ci.id = playbook_runs.config_id;
ON ci.id = playbook_runs.config_id;

CREATE OR REPLACE VIEW config_analysis_items AS
SELECT
ca.*,
ci.type as config_type,
ci.config_class
FROM config_analysis as ca
LEFT JOIN config_items as ci ON ca.config_id = ci.id;

CREATE OR REPLACE VIEW config_changes_items AS
SELECT
cc.*,
ci.type as config_type,
ci.config_class
FROM config_changes as cc
LEFT JOIN config_items as ci ON cc.config_id = ci.id;

0 comments on commit 060a5b4

Please sign in to comment.