6

I can see edits that have made to my posts, but I want to see edits that have been made to posts that I've edited (after I've edited them).

I mainly want to see which of my edits have been rolled back, but I'm also curious if I've missed anything that other editors have added or if I've introduced any mistakes with an edit.

2
  • 1
    Use the SEDE query on meta.stackexchange.com/a/353359/158100 as a starting point
    – rene
    Oct 29, 2020 at 22:03
  • @rene your query didn't work for me. I have a number of rolled-back edits (most recently this one) but I get no results for my user id of 3064538
    – user3064538
    Oct 30, 2020 at 4:35

1 Answer 1

5

This query does that for you.

The query uses a CTE to find in the PostHistory table the posts you edited or rolledback. The rows with PostHistoryTypeid 4 till 9 will indicate that. Once we have that set we can join with PostHistory again to find the posts that were edited / rolledback after you put your edit in.

;with PostsEdited as
(
  select distinct postid, creationdate
  from posthistory
  where userid = ##userid:int?3064538##
  and posthistorytypeid in (4, 5, 6, 7, 8, 9) -- edits, rollback
)
select distinct 
       ph.postid [Post Link]
     , ph.creationdate  
     , case ph.posthistorytypeid 
       when 4 then case when ph.userid < 0 then 'community' else 'edit' end
       when 5 then case when ph.userid < 0 then 'community' else 'edit' end
       when 6 then case when ph.userid < 0 then 'community' else 'edit' end       
       when 7 then 'rollback'
       when 8 then 'rollback'
       when 9 then 'rollback'
       end [edit/rollback] 
from posthistory ph
inner join PostsEdited pe 
  on pe.postid = ph.postid 
  and ph.posthistorytypeid in (4, 5, 6, 7, 8, 9) -- edits, rollback
  and pe.creationdate < ph.creationdate 
  and ph.userid <> ##userid:int?3064538##
order by ph.creationdate desc

When run today this is your result:

query result showing links, creationdate and edit or rollback

Keep in mind SEDE is updated once a week on Sunday.
Use the very useful SEDE Tutorial written by the awesome Monica Cellio.
Say "Hi" in SEDE chat.

0

You must log in to answer this question.