display history of topic updates on topic details page
[websub-hub] / src / db / postgres / sql / topic-publish-history.sql
1 --
2 SELECT
3 EXTRACT(DAY FROM now() - content_updated::date) AS days_ago,
4 count(*) AS content_updates
5 FROM topic_content_history
6 WHERE
7 (now() - content_updated::date) < ($(daysAgo) * INTERVAL '1 day')
8 AND
9 ($(topicIds) IS NULL OR topic_id = ANY($(topicIds)::uuid[]))
10 GROUP BY content_updated::date
11 ORDER BY content_updated::date
12 ;