Manual:Archive table/ja

archive テーブルは MediaWiki が削除されたページに関する情報を保管する所です The pages may be restored, or undeleted, by a MediaWiki Administrator using the Special:Undelete special page. MediaWiki 1.5 より、ページの内容は Text テーブルに残っています；削除時は Logging テーブル にログが記録されます.

ページが削除された場合、そのすべての過去のリビジョンは revision テーブル から archive テーブル に移されます. ページがそれから復元された場合、そのリビジョンは archive テーブル から取り除かれ、revision テーブル で再現されます.

The archive table is broadly related to the table and  table in layout; since  it has a primary key: ar_id.

MediaWiki 1.5 未満では、Text テーブル からの内容はここに動かされ、それで個々のリビジョンが空ではない ar_text の内容を持っていました. そのテキストは圧縮する事ができるはずで、それらの場合、それは Revision の ar_flags フィールドの上に gzip によって記録されます. それらの現在のものではない、削除が起きた時のレコードも、多数の削除サイクルを区別するか、あるいは過去の削除を長い期間編集されなかったページの最近の削除から区別することを、難しくしています. (Proposals to store this data in or  were rejected.)

mysql> DESCRIBE archive; +---+-+--+-+++ +---+-+--+-+++ +---+-+--+-+++ 19 rows in set (0.00 sec)
 * Field            | Type                | Null | Key | Default        | Extra          |
 * ar_id            | int(10) unsigned    | NO   | PRI | NULL           | auto_increment |
 * ar_namespace     | int(11)             | NO   | MUL | 0              |                |
 * ar_title         | varbinary(255)      | NO   |     |                |                |
 * ar_text          | mediumblob          | NO   |     | NULL           |                |
 * ar_comment       | tinyblob            | NO   |     | NULL           |                |
 * ar_user          | int(10) unsigned    | NO   |     | 0              |                |
 * ar_user_text     | varbinary(255)      | NO   | MUL | NULL           |                |
 * ar_timestamp     | binary(14)          | NO   |     |                |                |
 * ar_minor_edit    | tinyint(4)          | NO   |     | 0              |                |
 * ar_flags         | tinyblob            | NO   |     | NULL           |                |
 * ar_rev_id        | int(10) unsigned    | YES  | MUL | NULL           |                |
 * ar_text_id       | int(10) unsigned    | YES  |     | NULL           |                |
 * ar_deleted       | tinyint(3) unsigned | NO   |     | 0              |                |
 * ar_len           | int(10) unsigned    | YES  |     | NULL           |                |
 * ar_page_id       | int(10) unsigned    | YES  |     | NULL           |                |
 * ar_parent_id     | int(10) unsigned    | YES  |     | NULL           |                |
 * ar_sha1          | varbinary(32)       | NO   |     |                |                |
 * ar_content_model | varbinary(32)       | YES  |     | NULL           |                |
 * ar_content_format | varbinary(64)      | YES  |     | NULL           |                |

ar_id
主キーです.

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

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

ar_text
Before MediaWiki 1.5, old archived pages saved their text here. Old archived pages have ar_text_id set to NULL; they do not point to an entry in the text table. Instead, this field is the place where the text resides. Restoring content from an old archived page restores the text from this field.

Still used! In newly deleted pages (MediaWiki 1.5 and later), the revision text remains in the table. Such newly deleted pages will not store text in the archive table, but will rather reference the separately existing text rows. However, for text from pages, which have been archived in MediaWiki 1.4 and before, the ar_text field will still be used!

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.

ar_user
Basic revision information: contains the user ID of the user who made the deleted revision; it is the same as and. 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.

ar_timestamp
This field contains the time at which the revision was originally saved. It is the equivalent of.

This is not the timestamp of article deletion; that is saved in the deletion log entry, in the table's.

ar_minor_edit
Basic revision information: Records whether the user marked the deleted revision as a. If the value for this field is 1, then the edit is tagged as 'minor'; it is 0 otherwise. This is equivalent to.

ar_flags
This field is similar to in the  table. It was added in MediaWiki 1.5, but is most likely unused: For revisions archived with older versions, it is not used as it was not there at the time of their deletion; a conversion, which would have added flags for revisions, which already had been archived when the update to MediaWiki 1.5 or newer was being done, was not applied. Texts of revisions archived with MediaWiki 1.5 or later do not use this field; they themselves stay in the text table; together with their flags staying in.

ar_rev_id
When revisions are deleted, their unique is stored here so it can be retained after undeletion. This is necessary to retain permalinks to given revisions after accidental delete cycles or messy operations like history merges.

Old entries from 1.4 will be NULL here, and a new rev_id will be created on undeletion for those revisions.

ar_text_id
For revisions deleted in MediaWiki 1.5 and later, this is a key to within the  table; that is, it is the key to the stored text in the storage backend. To avoid breaking the block-compression scheme and otherwise making storage changes harder, the actual text is *not* deleted from the text table; rather, the text is merely hidden by removal of the page and revision entries. Comparable to.

Old entries deleted under MediaWiki 1.2-1.4 will have NULL values in this field, and their and  fields will be used to create a new text row upon undeletion.

ar_deleted
This field is reserved for the RevDelete/Suppression (Oversight) system. Equivalent to.

ar_len
This field contains the length of the deleted revision, in bytes. Analogous to.

ar_page_id
Reference to. Useful for sysadmin fixing of large pages merged together in the archives, or for cleanly restoring a page at its original ID number if possible. Comparable to. Will be NULL for pages deleted prior to 1.11.

ar_parent_id
The revision id of the previous revision to the page. Populated from. Will be null for revisions deleted prior to 1.13. First edits to newly created articles (and therefore the creation of the article) can be identified by the value of this field being 0.

ar_sha1
The SHA-1 text content hash in base-36. Populated from.

ar_content_format
Content format for the archived revision, which is NULL by default and only stored if it differs from the page's default.

ar_content_model
Content model for the archived revision, which is NULL by default and only stored if it differs from the page's default, as determined by ContentHandler::getDefaultModelFor( $title ).

以前のバージョン
DESCRIBE archive +---+-+--+-++---+ +---+-+--+-++---+ +---+-+--+-++---+
 * Field            | Type                | Null | Key | Default        | Extra |
 * ar_namespace     | int(11)             | NO   | MUL | 0              |       |
 * ar_title         | varbinary(255)      | NO   |     |                |       |
 * ar_text          | mediumblob          | NO   |     | NULL           |       |
 * ar_comment       | tinyblob            | NO   |     | NULL           |       |
 * ar_user          | int(10) unsigned    | NO   |     | 0              |       |
 * ar_user_text     | varbinary(255)      | NO   | MUL | NULL           |       |
 * ar_timestamp     | binary(14)          | NO   |     |                |       |
 * ar_minor_edit    | tinyint(4)          | NO   |     | 0              |       |
 * ar_flags         | tinyblob            | NO   |     | NULL           |       |
 * ar_rev_id        | int(10) unsigned    | YES  | MUL | NULL           |       |
 * ar_text_id       | int(10) unsigned    | YES  |     | NULL           |       |
 * ar_deleted       | tinyint(3) unsigned | NO   |     | 0              |       |
 * ar_len           | int(10) unsigned    | YES  |     | NULL           |       |
 * ar_page_id       | int(10) unsigned    | YES  |     | NULL           |       |
 * ar_parent_id     | int(10) unsigned    | YES  |     | NULL           |       |
 * ar_sha1          | varbinary(32)       | NO   |     |                |       |
 * ar_content_format | varbinary(64)      | YES  |     | NULL           |       |
 * ar_content_model | varbinary(32)       | YES  |     | NULL           |       |

DESCRIBE archive +---+-+--+-++---+ +---+-+--+-++---+ +---+-+--+-++---+
 * Field        | Type                | Null | Key | Default        | Extra |
 * ar_namespace | int(11)             | NO   | MUL | 0              |       |
 * ar_title     | varbinary(255)      | NO   |     |                |       |
 * ar_text      | mediumblob          | NO   |     | NULL           |       |
 * ar_comment   | tinyblob            | NO   |     | NULL           |       |
 * ar_user      | int(10) unsigned    | NO   |     | 0              |       |
 * ar_user_text | varbinary(255)      | NO   | MUL | NULL           |       |
 * ar_timestamp | binary(14)          | NO   |     |                |       |
 * ar_minor_edit | tinyint(4)         | NO   |     | 0              |       |
 * ar_flags     | tinyblob            | NO   |     | NULL           |       |
 * ar_rev_id    | int(10) unsigned    | YES  | MUL | NULL           |       |
 * ar_text_id   | int(10) unsigned    | YES  |     | NULL           |       |
 * ar_deleted   | tinyint(3) unsigned | NO   |     | 0              |       |
 * ar_len       | int(10) unsigned    | YES  |     | NULL           |       |
 * ar_page_id   | int(10) unsigned    | YES  |     | NULL           |       |
 * ar_parent_id | int(10) unsigned    | YES  |     | NULL           |       |
 * ar_sha1      | varbinary(32)       | NO   |     |                |       |

DESCRIBE archive +---+-+--+-++---+ +---+-+--+-++---+ +---+-+--+-++---+
 * Field        | Type                | Null | Key | Default        | Extra |
 * ar_namespace | int(11)             | NO   | MUL | 0              |       |
 * ar_title     | varbinary(255)      | NO   |     |                |       |
 * ar_text      | mediumblob          | NO   |     | NULL           |       |
 * ar_comment   | tinyblob            | NO   |     | NULL           |       |
 * ar_user      | int(10) unsigned    | NO   |     | 0              |       |
 * ar_user_text | varbinary(255)      | NO   | MUL | NULL           |       |
 * ar_timestamp | binary(14)          | NO   |     |                |       |
 * ar_minor_edit | tinyint(4)         | NO   |     | 0              |       |
 * ar_flags     | tinyblob            | NO   |     | NULL           |       |
 * ar_rev_id    | int(10) unsigned    | YES  |     | NULL           |       |
 * ar_text_id   | int(10) unsigned    | YES  |     | NULL           |       |
 * ar_deleted   | tinyint(3) unsigned | NO   |     | 0              |       |
 * ar_len       | int(10) unsigned    | YES  |     | NULL           |       |
 * ar_page_id   | int(10) unsigned    | YES  |     | NULL           |       |
 * ar_parent_id | int(10) unsigned    | YES  |     | NULL           |       |

+---+-+--+-+-+---+ +---+-+--+-+-+---+ +---+-+--+-+-+---+
 * 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   | MUL | 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    |       |
 * ar_deleted   | tinyint(1) unsigned | NO   |     | 0       |       |
 * ar_len       | int(8) unsigned     | YES  |     | NULL    |       |
 * ar_page_id   | int(10) unsigned    | YES  |     | NULL    |       |

+---+-+--+-+-+---+ +---+-+--+-+-+---+ +---+-+--+-+-+---+
 * 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(10) unsigned    | NO   |     | 0       |       |
 * ar_user_text | varchar(255)        | NO   | MUL | NULL    |       |
 * ar_timestamp | binary(14)          | NO   |     | NULL    |       |
 * ar_minor_edit | tinyint(4)         | NO   |     | 0       |       |
 * ar_flags     | tinyblob            | NO   |     | NULL    |       |
 * ar_rev_id    | int(10) unsigned    | YES  |     | NULL    |       |
 * ar_text_id   | int(10) unsigned    | YES  |     | NULL    |       |
 * ar_deleted   | tinyint(3) unsigned | NO   |     | 0       |       |
 * ar_len       | int(10) unsigned    | YES  |     | NULL    |       |
 * ar_page_id   | int(10) unsigned    | YES  |     | NULL    |       |

+---+-+--+-+-+---+ +---+-+--+-+-+---+ +---+-+--+-+-+---+
 * 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    |       |
 * ar_deleted   | tinyint(1) unsigned | NO   |     | 0       |       |
 * ar_len       | int(8) unsigned     | YES  |     | NULL    |       |

+---+-+--+-+-+---+ +---+-+--+-+-+---+ +---+-+--+-+-+---+
 * 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    |       |

+---+-+--+-+-+---+ +---+-+--+-+-+---+ +---+-+--+-+-+---+
 * 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            |      |     |         |       |