Manual talk:Revision table

From MediaWiki.org
Jump to: navigation, search

Trying to understand how some of the tables relate (Page,Archive,Revision,Text)... Is a current page's content also stored in the text table ? even though the field prefix is old_ ?

Yes, the content (current and past) is stored in text table. "Field names are a holdover from the 'old' revisions table in MediaWiki 1.4 and earlier" (tables.sql).

Contents

Problem with import wiki to MySQL[edit]

I have a dump of Simple Wikipedia of 9.9.2007 and MediaWiki version 1.11. Table revision in Simple WP has 9 fields, in MediaWiki - 11 fields.

So, when I have tried upload, I have got an error:

  • mysql> source /simple20070909/revision.sql
  • ERROR 1136 (21S01): Column count doesn't match value count at row 1

Remove two fields, source..., then add them back:

  • mysql> ALTER TABLE revision DROP COLUMN rev_len, DROP COLUMN rev_parent_id;
  • mysql> source /simple20070909/revision.sql
  • mysql> ALTER TABLE revision ADD COLUMN rev_len INT(10) UNSIGNED DEFAULT NULL AFTER rev_deleted, ADD COLUMN rev_parent_id INT(10) UNSIGNED DEFAULT NULL AFTER rev_len;

If two fields were not added, then MediaWiki generates an error:

  • from within function "Revision::fetchRow". MySQL returned error "1054: Unknown column 'rev_len' in 'field list' (localhost)".

--AKA MBG 11:48, 11 September 2007 (UTC)

Hostnames[edit]

There's an old discussion here: m:Talk:Privacy_policy/Archives/2003#Lookups. Apparently they were still shown on some Wiipedias in 2003. --Nemo 10:58, 18 August 2010 (UTC)

rev_sha1[edit]

Hi! I updated my wiki, but it doesn't show the actually pagecontent. As I've seen in the database, I recognized that the sha1-row isn't filled in in the newer revisions. How can I fill the rows? Sorry for my english. Arc96 (talk) 15:26, 7 July 2012 (UTC)

Hello, there's a maintenance script for it. It's not listed in the page yet but the name is quite descriptive, populate<something>.php. Nemo 21:50, 10 July 2012 (UTC)

Indices[edit]

Is this style okay, or do we need to use a wikitable? E.g.:

Indices for revision table
Index Fields
PRIMARY rev_id
rev_page_id rev_page, rev_id
rev_timestamp rev_timestamp
page_timestamp rev_page, rev_timestamp
user_timestamp rev_user, rev_timestamp
usertext_timestamp rev_user_text, rev_timestamp
page_user_timestamp rev_page, rev_user, rev_timestamp
Indices for revision table
Index Field 1 Field 2 Field 3
PRIMARY rev_id
rev_page_id rev_page rev_id
rev_timestamp rev_timestamp
page_timestamp rev_page rev_timestamp
user_timestamp rev_user rev_timestamp
usertext_timestamp rev_user_text rev_timestamp
page_user_timestamp rev_page rev_user rev_timestamp

The "show index in revision" format is easier to maintain, but doesn't tell you on one row what fields pertain to an index. Leucosticte (talk) 20:53, 4 November 2012 (UTC)