Extension talk:SpecialDeleteOldRevisions2

Is there any possibility of modifying this to allow deleting only deleted revisions, that is, the "archived" revisions that can be selected in the current version of the extension?

There are some times when it is helpful to keep a history, but when one would like to delete garbage revisions (e.g., revisions made during testing) and keep the size of the database down. I once (sort of) figured out how to do this through a MySQL query, but I'm not sure if it completely gets everything:

To list the deleted revisions:

SELECT `tblprefix_archive`.`ar_text_id`, `tblprefix_archive`.`ar_title`,`tblprefix_text`.`old_id`,`tblprefix_text`.`old_text` FROM tblprefix_archive, tblprefix_text WHERE ((`tblprefix_archive`.`ar_text_id` >0) AND (`tblprefix_text`.`old_id`=tblprefix_archive.ar_text_id)) ORDER BY `tblprefix_text`.`old_id` DESC

To delete them:

DELETE FROM tblprefix_text USING tblprefix_archive, tblprefix_text WHERE ((`tblprefix_archive`.`ar_text_id`>0) AND (`tblprefix_text`.`old_id` =`tblprefix_archive`.`ar_text_id`))

Is this a reasonable approach that gets all the old text (and all references to it) out of the database?

If you don't have time to change the extension, I'd appreciate any tips about how I could modify the extension myself (or at least fix my SQL queries), but I'm more of a "front-end" user - I don't know much about PHP or MySQL.

Thanks! --Fungiblename 19:51, 2 February 2009 (UTC)