Skip to content

Commit

Permalink
fix: duplicate related ids in related_configs_recursive
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Jun 19, 2024
1 parent 806c85b commit 6779043
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion views/006_config_views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ BEGIN
), all_ids AS (
SELECT edges.id FROM edges UNION SELECT edges.related_id as id FROM edges
), grouped_related_ids AS (
SELECT all_ids.id, array_agg(edges.related_id::TEXT) FILTER (WHERE edges.related_id IS NOT NULL) as related_ids
SELECT all_ids.id, array_agg(DISTINCT edges.related_id::TEXT) FILTER (WHERE edges.related_id IS NOT NULL) as related_ids
FROM all_ids
LEFT JOIN edges ON edges.id = all_ids.id
GROUP BY all_ids.id
Expand Down

0 comments on commit 6779043

Please sign in to comment.