post events: show post-related mod actions on post event page.
Show the following actions on the post events page: * Post bans and unbans * Post deletions and undeletions * Thumbnail regenerations and IQDB regenerations * Favorites moves * Rating locks and unlocks * Note locks and unlocks Fixes #3825: Events/Moderation page for each post should show eventual ban actions
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
class UpdatePostEventsToVersion2 < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
replace_view :post_events, version: 2, revert_to_version: 1
|
||||
end
|
||||
end
|
||||
@@ -1513,7 +1513,16 @@ UNION ALL
|
||||
post_replacements.post_id,
|
||||
post_replacements.creator_id,
|
||||
post_replacements.created_at AS event_at
|
||||
FROM public.post_replacements;
|
||||
FROM public.post_replacements
|
||||
UNION ALL
|
||||
( SELECT 'ModAction'::character varying AS model_type,
|
||||
mod_actions.id AS model_id,
|
||||
mod_actions.subject_id AS post_id,
|
||||
mod_actions.creator_id,
|
||||
mod_actions.created_at AS event_at
|
||||
FROM public.mod_actions
|
||||
WHERE ((mod_actions.subject_type)::text = 'Post'::text)
|
||||
ORDER BY mod_actions.created_at DESC);
|
||||
|
||||
|
||||
--
|
||||
@@ -6739,6 +6748,7 @@ INSERT INTO "schema_migrations" (version) VALUES
|
||||
('20220922014326'),
|
||||
('20220923010905'),
|
||||
('20220924092056'),
|
||||
('20220925045236');
|
||||
('20220925045236'),
|
||||
('20220926050108');
|
||||
|
||||
|
||||
|
||||
23
db/views/post_events_v02.sql
Normal file
23
db/views/post_events_v02.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
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'::character varying, id, post_id, user_id, created_at
|
||||
FROM post_disapprovals
|
||||
UNION ALL
|
||||
SELECT 'PostFlag'::character varying, id, post_id, creator_id, created_at
|
||||
FROM post_flags
|
||||
UNION ALL
|
||||
SELECT 'PostReplacement'::character varying, id, post_id, creator_id, created_at
|
||||
FROM post_replacements
|
||||
UNION ALL (
|
||||
SELECT 'ModAction'::character varying, id, subject_id, creator_id, created_at
|
||||
FROM mod_actions
|
||||
WHERE mod_actions.subject_type = 'Post'
|
||||
ORDER BY created_at DESC
|
||||
)
|
||||
Reference in New Issue
Block a user