2 -- Track category inclusions *used inline*
3 -- This tracks a single level of category membership
4 -- (folksonomic tagging, really).
6 CREATE TABLE /*$wgDBprefix*/categorylinks (
7 -- Key to page_id of the page defined as a category member.
8 cl_from
int(8) unsigned
NOT NULL default '0',
10 -- Name of the category.
11 -- This is also the page_title of the category's description page;
12 -- all such pages are in namespace 14 (NS_CATEGORY).
13 cl_to
varchar(255) binary NOT NULL default '',
15 -- The title of the linking page, or an optional override
16 -- to determine sort order. Sorting is by binary order, which
17 -- isn't always ideal, but collations seem to be an exciting
18 -- and dangerous new world in MySQL...
19 cl_sortkey
varchar(255) binary NOT NULL default '',
21 -- This isn't really used at present. Provided for an optional
22 -- sorting method by approximate addition time.
23 cl_timestamp
timestamp NOT NULL,
25 UNIQUE KEY cl_from(cl_from
,cl_to
),
27 -- This key is trouble. It's incomplete, AND it's too big
28 -- when collation is set to UTF-8. Bleeeacch!
29 KEY cl_sortkey(cl_to
,cl_sortkey(128)),
32 KEY cl_timestamp(cl_to
,cl_timestamp
)