Toolserver:Database schema/Article text and associated

This page was moved from the Toolserver wiki.
Toolserver has been replaced by Toolforge. As such, the instructions here may no longer work, but may still be of historical interest.
Please help by updating examples, links, template links, etc. If a page is still relevant, move it to a normal title and leave a redirect.

Article text and associated edit

Page edit

Each PAGE has an entry here which identifies it by title and contains some essential metadata.

Page table
Field Type Null Key Default Extra
page_id int(8) unsigned No 0
page_namespace int(11) No 0
page_title varbinary(255) No
page_restrictions tinyblob No NULL
page_counter bigint(20) unsigned No 0
page_is_redirect tinyint(1) unsigned No 0
page_is_new tinyint(1) unsigned No 0
page_random double unsigned No 0
page_touched varbinary(14) No
page_latest int(8) unsigned No 0
page_len int(8) unsigned No 0

Text edit

  • This table does not carry any current text (all July 2005 or older).
  • If your tool requires access to current text, please see the WikiProxy page on Meta.
Text table
Field Type Null Key Default Extra
old_id int(8) unsigned No 0
old_text mediumtext No Null
old_flags tinyblob No Null

Revision edit

Revision table
Field Type Null Key Default Extra
rev_id int(8) unsigned No 0
rev_page int(8) unsigned No 0
rev_text_id int(8) unsigned No 0
rev_comment varbinary(255) Yes Null
rev_user int(5) unsigned No 0
rev_user_text varbinary(255) No
rev_timestamp varbinary(14) No
rev_minor_edit tinyint(1) unsigned No 0
rev_deleted tinyint(1) unsigned No 0
rev_len int(8) unsigned Yes Null
rev_parent_id int(8) unsigned Yes Null

Archive edit

Archive table
Field Type Null Key Default Extra
ar_namespace int(11) No 0
ar_title varbinary(255) No
ar_user int(5) unsigned No 0
ar_user_text varbinary(255) No
ar_timestamp varbinary(255) No
ar_minor_edit tinyint(1) No 0
ar_flags tinyblob No Null
ar_rev_id int(8) unsigned Yes Null
ar_len int(8) unsigned Yes Null
ar_page_id int(10) unsigned Yes Null
ar_parent_id int(10) unsigned Yes Null

Page_restrictions edit

Page_restrictions table
Field Type Null Key Default Extra
pr_page int(8) No 0
pr_type varbinary(255) No
pr_level varbinary(255) No
pr_cascade tinyint(4) No 0
pr_user int(8) Yes Null
pr_expiry varbinary(14) Yes Null
pr_id int(10) unsigned No 0

Redirect edit

Redirect table
Field Type Null Key Default Extra
rd_from int(8) unsigned No 0
rd_namespace int(11) No 0
rd_title varbinary(255) No

Pagelinks edit

Pagelinks table
Field Type Null Key Default Extra
pl_from int(8) unsigned No 0
pl_namespace int(11) No 0
pl_title varbinary(255) No

Templatelinks edit

Templatelinks table
Field Type Null Key Default Extra
tl_from int(8) unsigned No 0
tl_namespace int(11) No 0
tl_title varbinary(255) No

Categorylinks edit

Categorylinks table
Field Type Null Key Default Extra
cl_from int(8) unsigned No 0
cl_to varbinary(255) No
cl_sortkey varbinary(230) No
cl_timestamp timestamp No 0000-00-00 00:00:00
cl_sortkey_prefix varbinary(255) No
cl_collation varbinary(32) No
cl_type enum('page','subcat','file') No page

Langlinks edit

Langlinks table
Field Type Null Key Default Extra
ll_from int(8) unsigned No 0
ll_lang varbinary(20) No
ll_title varbinary(255) No

Category:Database schema