Manual:Slots table/fi
↑ Manual:Sisällöt | MediaWiki database layout | slots table |
MediaWiki version: | ≥ 1.31 |
The slots table represent an n:m relation between revisions and content objects. A content object can have a specific "role" in one or more revisions. Each revision can have multiple content objects, each having a different role.
The table 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
slot_revision_id
Reference to revision.rev_id or archive.ar_rev_id. slot_revision_id and slot_role_id together comprise the primary key.
slot_role_id
Reference to slot_roles.role_id
slot_content_id
Reference to content.content_id
slot_origin
The revision.rev_id of the revision that originated the slot's content. To find revisions that changed slots, look for slot_origin = slot_revision_id. If there is only one slot on the page, it's always the same as slot_revision_id. But if there are multiple slots, they can differ. For instance, if you have two slots, "main" and "style", and "style" was changed in revision 3 but then "main" was changed in revision 4 and 5, slot_revision_id of the "style" slot would be 3 on revision five. Similarly slot_revision_id for the "main" slot would be different from 3 on revision three, if revision 3 only updated the "style" slot.
Schema
MediaWiki version: | ≥ 1.31 |
DESCRIBE slots;
+------------------+----------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------+----------------------+------+-----+---------+-------+ | slot_revision_id | bigint(20) unsigned | NO | PRI | NULL | | | slot_role_id | smallint(5) unsigned | NO | PRI | NULL | | | slot_content_id | bigint(20) unsigned | NO | | NULL | | | slot_origin | bigint(20) unsigned | NO | | NULL | | +------------------+----------------------+------+-----+---------+-------+
Indeksit
MediaWiki version: | ≥ 1.31 |
SHOW INDEX IN slots;
+-------+------------+---------------------------+--------------+------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +-------+------------+---------------------------+--------------+------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | slots | 0 | PRIMARY | 1 | slot_revision_id | A | 0 | NULL | NULL | | BTREE | | | | slots | 0 | PRIMARY | 2 | slot_role_id | A | 0 | NULL | NULL | | BTREE | | | | slots | 1 | slot_revision_origin_role | 1 | slot_revision_id | A | 0 | NULL | NULL | | BTREE | | | | slots | 1 | slot_revision_origin_role | 2 | slot_origin | A | 0 | NULL | NULL | | BTREE | | | | slots | 1 | slot_revision_origin_role | 3 | slot_role_id | A | 0 | NULL | NULL | | BTREE | | | +-------+------------+---------------------------+--------------+------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+