Ho un database SQL di Discourse. Devo trovare le statistiche degli utenti per un determinato timestamp.
Ad esempio: devo scoprire quanti post ha pubblicato un utente?
Se estraggo quei dati da user_stats, ottengo un numero che va dall’iscrizione al forum fino a ora, ma ho bisogno di trovare i dati per un periodo specifico.
Hai qualche idea?
The count shown in the UI is only for public, undeleted, posts. The database count is every post, including deleted posts, PMs, and private categories.
You will need to apply similar filters. Something like this:
SELECT count(*) FROM posts p
JOIN topics t ON t.id = p.topic_id
WHERE p.user_id=23968
AND p.deleted_at IS NULL
AND NOT COALESCE(p.hidden, 't')
AND p.post_type = 1
AND t.deleted_at IS NULL
AND COALESCE(t.visible, 't')
AND t.archetype <> 'private_message'
AND p.user_id > 0
AND p.post_number > 1