Дапамога:Табліца text

From mediawiki.org
This page is a translated version of the page Manual:Text table and the translation is 62% complete.
Manual:Contents MediaWiki database layout text table
MediaWiki version:
1.5

Табліца text зьмяшчае вікітэкст рэвізіяў асобнай старонкі. Калі вы карыстаецеся Postgres альбо Oracle, гэтая табліца называецца pagecontent. Extensions таксама могуць захоўваць у ёй свае зьвесткі.

Назвы палёў — спадчына з табліцы рэвізіяў old у MediaWiki 1.4 і раней.

Калі вы абнавілі сваю вікі з MediaWiki 1.4 ці старэйшай да навейшай, а пасьля гэтага хоць раз запусьцілі update.php, старыя слупкі ў табліцы text засталіся, а іхні зьмест быў прадубляваны ў табліцы page і revision (зьмест скапіяваны, а ня перанесены). Гэтыя слупкі з табліцы text больш нідзе ня будуць выкарыстоўвацца. Усе палі табліцы text, акрамя old_id, old_text і old_flags, больш не патрэбныя і могуць быць бясьпечна выдаленыя.

Тэкставы зьмест можа быць упакаваны ці захоўвацца вонкава, таму яго цяжка атрымаць з гэтай табліцы. Каб здабыць тэкст дадзенага old_id, можна скарыстацца скрыптом падтрымкі fetchText.php .

Extensions can add other custom flags.

This table can also hold metadata of files if the metadata is too big to store in img_metadata, oi_metadata or fa_metadata.

Палі

old_id

Унікальны лік дзеля ідэнтыфікацыі кожнага тэксту. It's referenced by the content.content_address in content table. Before Multi-Content Revisions implementation, revision.rev_text_id in revision table and ar_text_id in archive table were keys to this column.

Also img_metadata, oi_metadata or fa_metadata can refer to this column when being used to store file metadata.

old_text

The wikitext of the page, or a pointer to external storage of the form of DB://cluster/id.

old_flags

Сьпіс сьцяжкоў, падзелены коскамі. Зьмяшчае наступныя магчымыя значэньні:

gzip Тэкст сьціскаецца з дапамогай функцыі PHP gzdeflate().
Калі ўключаная опцыя $wgCompressRevisions , новыя радкі (= актуальныя рэвізіі) будуць празрыста зазіпаваныя пры захаваньні. З дапамогай скрыпту compressOld.php аналягічна можна сьціснуць і ранейшыя рэвізіі
utf-8 Тэкст захоўваўся ў UTF-8.
Калі ўключаная опцыя $wgLegacyEncoding , радкі бяз гэтага сьцяжку будуць празрыста сканвэртаныя ў UTF-8 пры загрузцы.
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.
external Text was stored in an external location specified by old_text.
Any additional flags apply to the data stored at that URL, not the URL itself. The 'object' flag is not set for URLs of the form 'DB://cluster/id/itemid', because the external storage system itself decompresses these. See also $wgDefaultExternalStore .

Падсумаваньне схемы

MediaWiki version:
1.10

DESCRIBE text;

+-----------+------------------+------+-----+---------+----------------+
| Field     | Type             | Null | Key | Default | Extra          |
+-----------+------------------+------+-----+---------+----------------+
| old_id    | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| old_text  | mediumblob       | NO   |     | NULL    |                |
| old_flags | tinyblob         | NO   |     | NULL    |                |
+-----------+------------------+------+-----+---------+----------------+
MediaWiki versions:
1.5 – 1.9

DESCRIBE text;

+-----------+-----------------+------+-----+---------+----------------+
| Field     | Type            | Null | Key | Default | Extra          |
+-----------+-----------------+------+-----+---------+----------------+
| old_id    | int(8) unsigned | NO   | PRI | NULL    | AUTO_INCREMENT |
| old_text  | mediumblob      | NO   |     | NULL    |                |
| old_flags | tinyblob        | NO   |     | NULL    |                |
+-----------+-----------------+------+-----+---------+----------------+

Indexes

MediaWiki version:
1.5

SHOW INDEX IN text;

+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| text  |          0 | PRIMARY  |            1 | old_id      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+

Глядзіце таксама