Manual:content_models table
From Linux Web Expert
↑ Manual:Contents | <translate> MediaWiki database layout</translate> | <translate> <tvar name=1>content_models</tvar> table</translate> |
<translate> ≥</translate> 1.31
<translate> MediaWiki version:</translate> |
The content_models table is a normalisation table for content model names. They are referenced from the content table.
In PHP code, normalisation is managed via NameTableStore .
It was introduced in MediaWiki 1.31 as part of the Multi-Content Revisions project; see Multi-Content Revisions/Content Meta-Data for details. During migration from older versions, the table is populated by populateContentTables.php (run automatically by the upgrade script).
Fields
model_id
Primary key.
model_name
To be documented.
Schema summary
<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>"><translate> ≥</translate> 1.36
<translate> MediaWiki version:</translate> |
DESCRIBE content_models;
+------------+---------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+---------------+------+-----+---------+----------------+ | model_id | int(11) | NO | PRI | NULL | auto_increment | | model_name | varbinary(64) | NO | UNI | NULL | | +------------+---------------+------+-----+---------+----------------+<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.35</tvar> is unsupported version</translate>">
1.31 – 1.35
<translate> MediaWiki versions:</translate> |
DESCRIBE content_models;
+------------+---------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+---------------+------+-----+---------+----------------+ | model_id | smallint(6) | NO | PRI | NULL | auto_increment | | model_name | varbinary(64) | NO | UNI | NULL | | +------------+---------------+------+-----+---------+----------------+
Indexes
<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>"><translate> ≥</translate> 1.31
<translate> MediaWiki version:</translate> |
SHOW INDEX IN content_models;
+----------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +----------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | content_models | 0 | PRIMARY | 1 | model_id | A | 0 | NULL | NULL | | BTREE | | | | content_models | 0 | model_name | 1 | model_name | A | 0 | NULL | NULL | | BTREE | | | +----------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+