Manual:Archive table

The archive table is where MediaWiki stores information on deleted articles. The articles may be restored. The content of the article remains in table text. The deletion time is logged in table logging.

If an article is deleted, all old revisions move from table revision to table archive. If you restore a text that specific revision is removed from table archive again and created in table revision.

Old Info, must be way before 1.6.8 It's broadly related to the old table in layout, but there are no row ID numbers so old values of cur_id and old_id are not restored when pages are undeleted. Like in the old table, individual revisions' ar_text contents may be compressed as indicated by 'gzip' in the ar_flags field. There is also not presently a record of when deletion occurred, making it hard to separate multiple delete cycles or distinguish old deletions from recent deletions of pages that haven't been edited in a long time.

ar_namespace
Basic revision information: contains the namespace of the deleted revision. These contain the value in page_namespace.

ar_title
Basic page information: contains the page title of the deleted page, which is the same as page_title.

ar_text
Not used; the revision text remains in the text table. Newly deleted pages will not store text in this table, but will rather reference the separately existing text rows. The behavior before MediaWiki 1.5 was different; old archived pages saved their text here, so this field remains for backward compatibility.

Text may be gzipped or otherwise funky.

ar_comment
Basic revision information: contains the edit summary of the deleted revision, analogous to rev_comment.

ar_user
Basic revision information: contains the user ID of the user who made the deleted revision; it is the same as user_id and rev_user. The value for this field is 0 for anonymous edits, initializations scripts, and for some mass imports.

ar_user_text
Basic revision information: This field contains the text of the editor's username, or the IP address of the editor if the deleted revision was done by an unregistered user. Comparable to rev_user_text.

ar_timestamp

 * original time of arcticle creation/last change (time of deletion is stored in table logging.log_timestamp)

ar_rev_id

 * Stores revision.rev_id from the former article. No use, as that revision entry is being deleted on deletion of the article.

ar_text_id

 * links to text.old_id for retrieval of the article

Schema summary
"DESCRIBE archive" in versions before 1.5 gives the following:

+---+-+--+-+-+---+ +---+-+--+-+-+---+ +---+-+--+-+-+---+
 * Field        | Type                | Null | Key | Default | Extra |
 * ar_namespace | tinyint(2) unsigned |      |     | 0       |       |
 * ar_title     | varchar(255) binary |      |     |         |       |
 * ar_text      | mediumtext          |      |     |         |       |
 * ar_comment   | tinyblob            |      |     |         |       |
 * ar_user      | int(5) unsigned     |      |     | 0       |       |
 * ar_user_text | varchar(255) binary |      |     |         |       |
 * ar_timestamp | varchar(14) binary  |      |     |         |       |
 * ar_minor_edit | tinyint(1)         |      |     | 0       |       |
 * ar_flags     | tinyblob            |      |     |         |       |

"DESCRIBE archive" in version 1.5 gives the following:

+---+-+--+-+-+---+ +---+-+--+-+-+---+ +---+-+--+-+-+---+
 * Field        | Type            | Null | Key | Default | Extra |
 * ar_namespace | int(11)         | NO   | MUL | 0       |       |
 * ar_title     | varchar(255)    | NO   |     |         |       |
 * ar_text      | mediumblob      | NO   |     |         |       |
 * ar_comment   | tinyblob        | NO   |     |         |       |
 * ar_user      | int(5) unsigned | NO   |     | 0       |       |
 * ar_user_text | varchar(255)    | NO   |     |         |       |
 * ar_timestamp | char(14)        | NO   |     |         |       |
 * ar_minor_edit | tinyint(1)     | NO   |     | 0       |       |
 * ar_flags     | tinyblob        | NO   |     |         |       |
 * ar_rev_id    | int(8) unsigned | YES  |     | NULL    |       |
 * ar_text_id   | int(8) unsigned | YES  |     | NULL    |       |

"DESCRIBE archive" in version 1.8 gives the following: +---+-+--+-+-+---+ +---+-+--+-+-+---+ +---+-+--+-+-+---+
 * Field        | Type            | Null | Key | Default | Extra |
 * ar_namespace | int(11)         | NO   | MUL | 0       |       |
 * ar_title     | varchar(255)    | NO   |     | NULL    |       |
 * ar_text      | mediumblob      | NO   |     | NULL    |       |
 * ar_comment   | tinyblob        | NO   |     | NULL    |       |
 * ar_user      | int(5) unsigned | NO   |     | 0       |       |
 * ar_user_text | varchar(255)    | NO   |     | NULL    |       |
 * ar_timestamp | char(14)        | NO   |     | NULL    |       |
 * ar_minor_edit | tinyint(1)     | NO   |     | 0       |       |
 * ar_flags     | tinyblob        | NO   |     | NULL    |       |
 * ar_rev_id    | int(8) unsigned | YES  |     | NULL    |       |
 * ar_text_id   | int(8) unsigned | YES  |     | NULL    |       |

mysql> describe mw_archive;

+---+-+--+-+-+---+ +---+-+--+-+-+---+ +---+-+--+-+-+---+
 * Field        | Type            | Null | Key | Default | Extra |
 * ar_namespace | int(11)         | NO   | MUL | 0       |       |
 * ar_title     | varchar(255)    | NO   |     | NULL    |       |
 * ar_text      | mediumblob      | NO   |     | NULL    |       |
 * ar_comment   | tinyblob        | NO   |     | NULL    |       |
 * ar_user      | int(5) unsigned | NO   |     | 0       |       |
 * ar_user_text | varchar(255)    | NO   |     | NULL    |       |
 * ar_timestamp | char(14)        | NO   |     | NULL    |       |
 * ar_minor_edit | tinyint(1)     | NO   |     | 0       |       |
 * ar_flags     | tinyblob        | NO   |     | NULL    |       |
 * ar_rev_id    | int(8) unsigned | YES  |     | NULL    |       |
 * ar_text_id   | int(8) unsigned | YES  |     | NULL    |       |

As of MW 1.6.8:


 * ar_text
 * not used, text is still stored in table text


 * ar_comment
 * not used, comment ist stored in table logging.log_comment


 * ar_timestamp
 * original time of arcticle creation/last change (time of deletion is stored in table logging.log_timestamp)


 * ar_rev_id
 * Stores revision.rev_id from the former article. No use, as that revision entry is being deleted on deletion of the article.


 * ar_text_id
 * links to text.old_id for retrieval of the article