Branch merge of change-tagging branch with trunk
[lhc/web/wiklou.git] / maintenance / archives / patch-change_tag.sql
1 -- A table to track tags for revisions, logs and recent changes.
2 -- Andrew Garrett, 2009-01
3 CREATE TABLE /*_*/change_tag (
4 ct_rc_id int NULL,
5 ct_log_id int NULL,
6 ct_rev_id int NULL,
7 ct_tag varchar(255) NOT NULL,
8 ct_params BLOB NULL,
9
10 UNIQUE KEY (ct_rc_id,ct_tag),
11 UNIQUE KEY (ct_log_id,ct_tag),
12 UNIQUE KEY (ct_rev_id,ct_tag),
13 KEY (ct_tag,ct_rc_id,ct_rev_id,ct_log_id) -- Covering index, so we can pull all the info only out of the index.
14 ) /*$wgDBTableOptions*/;
15
16 -- Rollup table to pull a LIST of tags simply without ugly GROUP_CONCAT that only works on MySQL 4.1+
17 CREATE TABLE /*_*/tag_summary (
18 ts_rc_id int NULL,
19 ts_log_id int NULL,
20 ts_rev_id int NULL,
21 ts_tags BLOB NOT NULL,
22
23 UNIQUE KEY (ts_rc_id),
24 UNIQUE KEY (ts_log_id),
25 UNIQUE KEY (ts_rev_id)
26 ) /*$wgDBTableOptions*/;
27
28 CREATE TABLE /*_*/valid_tag (
29 vt_tag varchar(255) NOT NULL,
30 PRIMARY KEY (vt_tag)
31 ) /*$wgDBTableOptions*/;