added /*$wgDBprefix*/ in various places, to support upgrading from old prefixed datab...
[lhc/web/wiklou.git] / maintenance / archives / patch-linktables.sql
1 --
2 -- Track links that do exist
3 -- l_from and l_to key to cur_id
4 --
5 DROP TABLE IF EXISTS /*$wgDBprefix*/links;
6 CREATE TABLE /*$wgDBprefix*/links (
7 l_from int(8) unsigned NOT NULL default '0',
8 l_to int(8) unsigned NOT NULL default '0',
9 UNIQUE KEY l_from(l_from,l_to),
10 KEY (l_to)
11 );
12
13 --
14 -- Track links to pages that don't yet exist.
15 -- bl_from keys to cur_id
16 -- bl_to is a text link (namespace:title)
17 --
18 DROP TABLE IF EXISTS /*$wgDBprefix*/brokenlinks;
19 CREATE TABLE /*$wgDBprefix*/brokenlinks (
20 bl_from int(8) unsigned NOT NULL default '0',
21 bl_to varchar(255) binary NOT NULL default '',
22 UNIQUE KEY bl_from(bl_from,bl_to),
23 KEY (bl_to)
24 );
25
26 --
27 -- Track links to images *used inline*
28 -- il_from keys to cur_id, il_to keys to image_name.
29 -- We don't distinguish live from broken links.
30 --
31 DROP TABLE IF EXISTS /*$wgDBprefix*/imagelinks;
32 CREATE TABLE /*$wgDBprefix*/imagelinks (
33 il_from int(8) unsigned NOT NULL default '0',
34 il_to varchar(255) binary NOT NULL default '',
35 UNIQUE KEY il_from(il_from,il_to),
36 KEY (il_to)
37 );
38
39 --
40 -- Stores (possibly gzipped) serialized objects with
41 -- cache arrays to reduce database load slurping up
42 -- from links and brokenlinks.
43 --
44 DROP TABLE IF EXISTS /*$wgDBprefix*/linkscc;
45 CREATE TABLE /*$wgDBprefix*/linkscc (
46 lcc_pageid INT UNSIGNED NOT NULL UNIQUE KEY,
47 lcc_cacheobj MEDIUMBLOB NOT NULL
48 );