Fix comment::children_count

This commit is contained in:
2019-10-16 14:40:21 +02:00
parent 8cb5c35296
commit 54393000b3

View File

@@ -12,7 +12,7 @@ begin
from (
select
com.*,
(select count(*) from "comment" c2 where c2.parents_ids @> array[com.id]) as children_count,
(select count(c2) from "comment" c2 where c2.parent_comment_id = com.id) as children_count,
find_reference_by_id(com.target_id, com.target_reference) as target,
find_citizen_by_id(com.created_by_id) as created_by,
count_vote(com.id) as votes