I’ve been editing posts on my board, mainly in order to fix weird post formating after importing the old database and also to convert links to oneboxes – it needed a little work, but it’s done now.
The problem is that many posts now have 2-5 revisions, which makes the database larger. The posts revisions could be safely removed because I obviously don’t need them, at least these ones.
So is there a way to remove all the post revisions somehow?
I would not worry about that.
An image would be worth 100s (if not 1000s) of post revisions storage-wise.
Hmm, but is there a way to remove them all? I’m just curious
If you know SQL, then it’s two queries away
- delete everything in the
public_version on the
posts table to 1
I think that’s the solution I’ve been looking for. I’ll test how it works and see whether it’s worth doing.
Ok, so it would be something like this, right?
discourse-# \connect discourse
discourse=# delete from post_revisions *;
discourse=# update posts set public_version=1 where public_version>1;
discourse=# update posts set version=1 where version>1;