Files
danbooru/db/views/post_events_v01.sql
evazion 361af6a4cb posts: rework post events page.
* Add a global /post_events page that shows the history of all approvals,
  disapprovals, flags, appeals, and replacements on a single page.

* Redesign the /posts/:id/events page to show all approval, disapproval,
  flag, appeal, and replacement events for a single post (before it only
  showed approvals, flags, and appeals).

* Remove the replacement history link from the post show page. Replacements
  are now included in the post events page (closes #4948: Highlighed replacements).

* Add /post_approvals/:id and /post_replacements/:id routes (these are
  used by the "Details" link on the post events page).
2022-09-24 20:12:41 -05:00

18 lines
641 B
SQL

SELECT 'Post'::character varying AS model_type, id AS model_id, id AS post_id, uploader_id AS creator_id, created_at AS event_at
FROM posts
UNION ALL
SELECT 'PostAppeal'::character varying, id, post_id, creator_id, created_at
FROM post_appeals
UNION ALL
SELECT 'PostApproval'::character varying, id, post_id, user_id, created_at
FROM post_approvals
UNION ALL
SELECT 'PostDisapproval', id, post_id, user_id, created_at
FROM post_disapprovals
UNION ALL
SELECT 'PostFlag', id, post_id, creator_id, created_at
FROM post_flags
UNION ALL
SELECT 'PostReplacement', id, post_id, creator_id, created_at
FROM post_replacements