Requests for comment/Page deletion
Particularly, moving page deletion to a RevDelete mechanism would solve:
- Bugzilla:21279 RevDelete + Normal deletion break log links.
- Bugzilla:18104 Deleted revisions should be identified by id, not timestamp.
- Easy comparison between deleted revisions and existing ones.
- It is really expensive to delete pages with lots of revisions.
- Page protection can be kept on delete + undelete cycles.
- Groups of revisions that are deleted are merged with all other deleted revisions for that page making them indistinguishable from each other.
|New table||New field|
|+ Easier upgrade. Doesn't require a schema change on page||+ MediaWiki user doesn't need mysql DELETE right on page|
|With support for deleted pages:
||- name_title index is polluted with many useless entries (not too important)|
|- Creates yet another table||- Bigger exposure of deleted data from third party programs / old extensions|
|+ Does not compromise the uniqueness of (page_id, page_title)||+ All page_ids live in one table.|
|- All existing queries would need to be modified to add the "is not deleted" condition|
Proposed solutions 
archived_page table 
Use a table similar to page which holds page content when it is deleted.
Deleting a page is moving the page entry to a new entry in the archived_page table.
We could have different deleted pages: groups of revisions which once existed at the same history. So revisions are no longer mixed. Each deleted page has a different page_id (although they share namespace and title). In such case, page creation produces a new page_id.
Otherwise, page creation recovers the entry from archived_page.
- PRO: page JOIN already done in core. Also, most places want to join to get the page for other reasons anyway, so this has some "secure by default" nature to it. Aaron 20:23, 27 October 2011 (UTC)
page_deleted field 
Add a page_deleted field to the table page.
The page is marked on the page_deleted bitfield as no longer existing. Another option would be to define that page doesn't exist if it has no visible [latest] edit (page_latest=0?).
Page creation reuses the same page entry if it exists.
- CON: We will need to add "rev_page = page_id AND page_deleted = 0" checks in revision queries.
- CON: What happens to the old page entry? Moved to another table? Aaron 20:23, 27 October 2011 (UTC)
Delete revisions on page deletion? 
With either approach, we could mark as deleted all revisions or rely on the page change to not allow them to be accessed. The later favours fast deletion and undeletion. The first aims for consistency. However, deleting one revision, then deleting the full page and undeleting should have kept that revision gone...