1 -- https://github.com/dessalines/lemmy/issues/197
4 -- Do the reply_view referencing the comment_mview
5 create view reply_view as
9 c2.creator_id as sender_id,
10 c.creator_id as recipient_id
12 inner join comment c2 on c.id = c2.parent_id
13 where c2.creator_id != c.creator_id
14 -- Do union where post is null
18 c.creator_id as sender_id,
19 p.creator_id as recipient_id
20 from comment c, post p
21 where c.post_id = p.id and c.parent_id is null and c.creator_id != p.creator_id
24 closereply.recipient_id
25 from comment_mview cv, closereply
26 where closereply.id = cv.id