Manual:Old table

The old table is where MediaWiki versions up to MediaWiki 1.4 store historical versions of articles; these MediaWiki versions store the current version of articles in the cur table. Most fields of the old table correspond to the same fields in the cur table.

In MediaWiki 1.5 the contents of the old table and of the cur table were merged together and moved to the page table, the revision table and the text table. Finally the table "old" was renamed to "text".

After running the updater when updating from MediaWiki 1.4 or older to a newer version, all fields in the text table except old_id, old_text and old_flags are not needed anymore and can be safely deleted.

old_text contents may be compressed, as indicated by "gzip" in the old_flags field. (Data is compressed with the gzdeflate function of PHP: there is no gzip header or checksum, set the window size to negative(?) if not using PHP to read data.)

old_id serves as a unique index for a given revision, with some caveats:
 * Since the cur table carries the most recent revision separately, old_id is not assigned to a revision until it is no longer the most recent version of a page
 * Since the archive table does not preserve the id number, it will be different after deletion/restoration (but the old number is not reused)
 * old_id is not necessarily numerically chronological, either within a given page's history or in the whole database

old_timestamp also may not be unique in a page history series.

"DESCRIBE old" gives the following:

+---+-+--+-+-++ +---+-+--+-+-++ +---+-+--+-+-++
 * Field            | Type                | Null | Key | Default | Extra          |
 * old_id           | int(8) unsigned     |      | PRI | NULL    | auto_increment |
 * old_namespace    | tinyint(2) unsigned |      |     | 0       |                |
 * old_title        | varchar(255) binary |      |     |         |                |
 * old_text         | mediumtext          |      |     |         |                |
 * old_comment      | tinyblob            |      |     |         |                |
 * old_user         | int(5) unsigned     |      |     | 0       |                |
 * old_user_text    | varchar(255) binary |      |     |         |                |
 * old_timestamp    | varchar(14) binary  |      |     |         |                |
 * old_minor_edit   | tinyint(1)          |      |     | 0       |                |
 * old_flags        | tinyblob            |      |     |         |                |
 * inverse_timestamp | varchar(14) binary |      |     |         |                |