wiki.techinc.nl/maintenance/archives/patch-categorylinks.sql
Brion Vibber ac9621badb Add categorylinks table to separately list category relationships. Actual
_page_ links to category pages like [[:category:Some cat]] will stay in
links/brokenlinks and not be listed in the category page list anymore.

A link can optionally specify a sort key like this: [[category:cat|Sort me]].
The page will then be sorted in category lists according to the given text
instead of the page name; thus categories may be sorted arbitrarily, by
last name or whatever.

There is also a timestamp field included on gwicke's request; this is not
used yet. Also it will currently be updated at every edit of the page,
this can be changed by implementing differential updating for the cat links.

TODO:
* Make sure that automatic sort keys are updated on page rename.
* Make sure cateory pages get cache-invalidated and purged
* Use proper text sorting instead of raw binary sort
* Allow specification of the display style on category pages: comma list
  or bullet list or number list; by sortkey or by timestamp; etc
2004-05-15 00:29:39 +00:00

15 lines
579 B
SQL

--
-- Track category inclusions *used inline*
-- cl_from keys to cur_id, cl_to keys to cur_title of the category page.
-- cl_sortkey is the title of the linking page or an optional override
-- cl_timestamp marks when the link was last added
--
CREATE TABLE categorylinks (
cl_from int(8) unsigned NOT NULL default '0',
cl_to varchar(255) binary NOT NULL default '',
cl_sortkey varchar(255) binary NOT NULL default '',
cl_timestamp timestamp NOT NULL,
UNIQUE KEY cl_from(cl_from,cl_to),
KEY cl_sortkey(cl_to,cl_sortkey(128)),
KEY cl_timestamp(cl_to,cl_timestamp)
);