Split down patch-comment-table.sql
[lhc/web/wiklou.git] / maintenance / archives / patch-slots.sql
1 --
2 -- Slots represent an n:m relation between revisions and content objects.
3 -- A content object can have a specific "role" in one or more revisions.
4 -- Each revision can have multiple content objects, each having a different role.
5 --
6 CREATE TABLE /*_*/slots (
7
8 -- reference to rev_id
9 slot_revision_id bigint unsigned NOT NULL,
10
11 -- reference to role_id
12 slot_role_id smallint unsigned NOT NULL,
13
14 -- reference to content_id
15 slot_content_id bigint unsigned NOT NULL,
16
17 -- The revision ID of the revision that originated the slot's content.
18 -- To find revisions that changed slots, look for slot_origin = slot_revision_id.
19 slot_origin bigint unsigned NOT NULL,
20
21 PRIMARY KEY ( slot_revision_id, slot_role_id )
22 ) /*$wgDBTableOptions*/;
23
24 -- Index for finding revisions that modified a specific slot
25 CREATE INDEX /*i*/slot_revision_origin_role ON /*_*/slots (slot_revision_id, slot_origin, slot_role_id);