Skip to content

Commit

Permalink
fix: default to zero when config count returns null
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe authored and moshloop committed Jan 22, 2024
1 parent 4009672 commit b214400
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions views/006_config_views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,10 @@ CREATE OR REPLACE VIEW config_detail AS
SELECT
ci.*,
json_build_object(
'relationships', related.related_count + reverse_related.related_count,
'analysis', analysis.analysis_count,
'changes', config_changes.changes_count,
'playbook_runs', playbook_runs.playbook_runs_count
'relationships', COALESCE(related.related_count, 0) + COALESCE(reverse_related.related_count, 0),
'analysis', COALESCE(analysis.analysis_count, 0),
'changes', COALESCE(config_changes.changes_count, 0),
'playbook_runs', COALESCE(playbook_runs.playbook_runs_count, 0)
) as summary
FROM config_items as ci
LEFT JOIN
Expand Down

0 comments on commit b214400

Please sign in to comment.