1 -- Make sure bots aren't included in aggregate counts
2 CREATE OR REPLACE FUNCTION community_aggregates_activity (i text)
19 INNER JOIN post p ON c.post_id = p.id
20 INNER JOIN person pe ON c.creator_id = pe.id
22 c.published > ('now'::timestamp - i::interval)
23 AND pe.bot_account = FALSE
30 INNER JOIN person pe ON p.creator_id = pe.id
32 p.published > ('now'::timestamp - i::interval)
33 AND pe.bot_account = FALSE) a
39 CREATE OR REPLACE FUNCTION site_aggregates_activity (i text)
53 INNER JOIN person u ON c.creator_id = u.id
54 INNER JOIN person pe ON c.creator_id = pe.id
56 c.published > ('now'::timestamp - i::interval)
58 AND pe.bot_account = FALSE
64 INNER JOIN person u ON p.creator_id = u.id
65 INNER JOIN person pe ON p.creator_id = pe.id
67 p.published > ('now'::timestamp - i::interval)
69 AND pe.bot_account = FALSE) a;