How can I export the data for users like wrt to a post or discussion? The information required will include user ID, post or topic id and the like.
What do you want? The user record for every user who has posted in a topic?
Yes, to review which user has liked which post or topic
This should be possible using something like:
-- [params]
-- topic_id :topic_id
-- int :post_number
SELECT pa.created_at::date,
pa.user_id
FROM post_actions pa
JOIN posts p ON p.id = pa.post_id
WHERE p.topic_id = :topic_id
AND p.post_number = :post_number
AND pa.post_action_type_id = 2
ORDER BY pa.created_at DESC
That one would be for an individual post, giving a list of users who liked it and when.
1 Like