2004-05-15 00:29:39 +00:00
|
|
|
--
|
|
|
|
|
-- Track category inclusions *used inline*
|
2005-05-02 08:40:17 +00:00
|
|
|
-- This tracks a single level of category membership
|
|
|
|
|
-- (folksonomic tagging, really).
|
2004-05-15 00:29:39 +00:00
|
|
|
--
|
2005-01-14 13:33:17 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/categorylinks (
|
2005-05-02 08:40:17 +00:00
|
|
|
-- Key to page_id of the page defined as a category member.
|
2004-05-15 00:29:39 +00:00
|
|
|
cl_from int(8) unsigned NOT NULL default '0',
|
2005-05-02 08:40:17 +00:00
|
|
|
|
|
|
|
|
-- Name of the category.
|
|
|
|
|
-- This is also the page_title of the category's description page;
|
|
|
|
|
-- all such pages are in namespace 14 (NS_CATEGORY).
|
2004-05-15 00:29:39 +00:00
|
|
|
cl_to varchar(255) binary NOT NULL default '',
|
2005-07-02 11:16:26 +00:00
|
|
|
|
2005-05-02 08:40:17 +00:00
|
|
|
-- The title of the linking page, or an optional override
|
|
|
|
|
-- to determine sort order. Sorting is by binary order, which
|
|
|
|
|
-- isn't always ideal, but collations seem to be an exciting
|
|
|
|
|
-- and dangerous new world in MySQL...
|
2005-07-02 11:16:26 +00:00
|
|
|
--
|
|
|
|
|
-- For MySQL 4.1+ with charset set to utf8, the sort key *index*
|
|
|
|
|
-- needs cut to be smaller than 1024 bytes (at 3 bytes per char).
|
|
|
|
|
-- To sort properly on the shorter key, this field needs to be
|
|
|
|
|
-- the same shortness.
|
|
|
|
|
cl_sortkey varchar(86) binary NOT NULL default '',
|
2005-05-02 08:40:17 +00:00
|
|
|
|
|
|
|
|
-- This isn't really used at present. Provided for an optional
|
|
|
|
|
-- sorting method by approximate addition time.
|
2004-05-15 00:29:39 +00:00
|
|
|
cl_timestamp timestamp NOT NULL,
|
2005-05-02 08:40:17 +00:00
|
|
|
|
2004-05-15 00:29:39 +00:00
|
|
|
UNIQUE KEY cl_from(cl_from,cl_to),
|
2005-05-02 08:40:17 +00:00
|
|
|
|
|
|
|
|
-- This key is trouble. It's incomplete, AND it's too big
|
|
|
|
|
-- when collation is set to UTF-8. Bleeeacch!
|
2005-07-02 11:16:26 +00:00
|
|
|
KEY cl_sortkey(cl_to,cl_sortkey),
|
2005-05-02 08:40:17 +00:00
|
|
|
|
|
|
|
|
-- Not really used?
|
2004-05-15 00:29:39 +00:00
|
|
|
KEY cl_timestamp(cl_to,cl_timestamp)
|
2005-05-02 08:40:17 +00:00
|
|
|
|
2006-04-08 21:11:13 +00:00
|
|
|
) TYPE=InnoDB;
|