From 63f43013c36afec6b53be0e0ff445feb47376334 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Tue, 2 Feb 2021 02:11:16 +0100 Subject: [PATCH] Removed superfluous grandparent from entity query. --- src/entities.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/entities.js b/src/entities.js index 4d313646..6c4b325d 100644 --- a/src/entities.js +++ b/src/entities.js @@ -133,7 +133,6 @@ async function fetchIncludedEntities() { SELECT parents.*, json_agg(included_entities ORDER BY included_entities.id) included_children, - row_to_json(grandparents) AS parent, (SELECT json_agg(children) FROM entities AS children WHERE children.parent_id = parents.id) children @@ -141,12 +140,10 @@ async function fetchIncludedEntities() { included_entities LEFT JOIN entities AS parents ON parents.id = included_entities.parent_id - LEFT JOIN - entities AS grandparents ON grandparents.id = parents.parent_id WHERE included_entities.type = 'channel' GROUP BY - parents.id, grandparents.id + parents.id ), entity_tree as ( /* get recursive parents of networks (necessary for scraper resolve) */ SELECT to_jsonb(included_per_network) as entity,