User:RichMorin/mw text

From Meta, a Wikimedia project coordination wiki

Holds text of individual page revisions.

Field names are a holdover from the 'old' revisions table in MediaWiki 1.4 and earlier: an upgrade will transform that table into the 'text' table to minimize unnecessary churning and downtime. If upgrading, the other fields will be left unused.


Inter-table Relationships[edit]

NA


MySQL Table Description[edit]

mysql> desc mw_text;
+-----------+-----------------+------+-----+---------+----------------+
| Field     | Type            | Null | Key | Default | Extra          |
+-----------+-----------------+------+-----+---------+----------------+
| old_id    | int(8) unsigned |      | PRI | NULL    | auto_increment |
| old_text  | mediumblob      |      |     |         |                |
| old_flags | tinyblob        |      |     |         |                |
+-----------+-----------------+------+-----+---------+----------------+
3 rows in set


Annotated Table Creation Code[edit]

-- Holds text of individual page revisions.
--
-- Field names are a holdover from the 'old' revisions table in
-- MediaWiki 1.4 and earlier: an upgrade will transform that
-- table into the 'text' table to minimize unnecessary churning
-- and downtime. If upgrading, the other fields will be left unused.


CREATE TABLE /*$wgDBprefix*/text (

  -- Unique text storage key number.
  -- Note that the 'oldid' parameter used in URLs does *not*
  -- refer to this number anymore, but to rev_id.

  old_id              int(8)         unsigned     NOT NULL  auto_increment,
  
  -- Depending on the contents of the old_flags field, the text
  -- may be convenient plain text, or it may be funkily encoded.

  old_text            mediumblob                  NOT NULL  default '',
  
  -- Comma-separated list of flags:
  --
  -- gzip:   text is compressed with PHP's gzdeflate() function.
  --
  -- utf8:   text was stored as UTF-8.
  --         If $wgLegacyEncoding option is on, rows *without* this flag
  --         will be converted to UTF-8 transparently at load time.
  --
  -- object: text field contained a serialized PHP object.
  --         The object either contains multiple versions
  --         (compressed together to achieve a better compression ratio)
  --         or it refers to another row where the text can be found.

  old_flags           tinyblob                    NOT NULL  default '',
  
PRIMARY KEY           old_id (old_id)

) ENGINE=InnoDB;