X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Farchives%2Fpatch-linktables.sql;h=d53d2ea3ad5e8d025da7fc298932e605e1fea556;hb=904945eaeefe7febd6622e191494fb867d9df84e;hp=45361e8876478422136cdf91b41bb969a3836a48;hpb=722e946b528596128e4804eed3a5b245787e2ddf;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/archives/patch-linktables.sql b/maintenance/archives/patch-linktables.sql index 45361e8876..d53d2ea3ad 100644 --- a/maintenance/archives/patch-linktables.sql +++ b/maintenance/archives/patch-linktables.sql @@ -4,11 +4,19 @@ -- DROP TABLE IF EXISTS /*$wgDBprefix*/links; CREATE TABLE /*$wgDBprefix*/links ( - l_from int(8) unsigned NOT NULL default '0', - l_to int(8) unsigned NOT NULL default '0', + -- Key to the page_id of the page containing the link. + l_from int unsigned NOT NULL default '0', + + -- Key to the page_id of the link target. + -- An unfortunate consequence of this is that rename + -- operations require changing the links entries for + -- all links to the moved page. + l_to int unsigned NOT NULL default '0', + UNIQUE KEY l_from(l_from,l_to), KEY (l_to) -); + +) /*$wgDBTableOptions*/; -- -- Track links to pages that don't yet exist. @@ -17,11 +25,17 @@ CREATE TABLE /*$wgDBprefix*/links ( -- DROP TABLE IF EXISTS /*$wgDBprefix*/brokenlinks; CREATE TABLE /*$wgDBprefix*/brokenlinks ( - bl_from int(8) unsigned NOT NULL default '0', + -- Key to the page_id of the page containing the link. + bl_from int unsigned NOT NULL default '0', + + -- Text of the target page title ("namesapce:title"). + -- Unfortunately this doesn't split the namespace index + -- key and therefore can't easily be joined to anything. bl_to varchar(255) binary NOT NULL default '', UNIQUE KEY bl_from(bl_from,bl_to), KEY (bl_to) -); + +) /*$wgDBTableOptions*/; -- -- Track links to images *used inline* @@ -30,11 +44,18 @@ CREATE TABLE /*$wgDBprefix*/brokenlinks ( -- DROP TABLE IF EXISTS /*$wgDBprefix*/imagelinks; CREATE TABLE /*$wgDBprefix*/imagelinks ( - il_from int(8) unsigned NOT NULL default '0', + -- Key to page_id of the page containing the image / media link. + il_from int unsigned NOT NULL default '0', + + -- Filename of target image. + -- This is also the page_title of the file's description page; + -- all such pages are in namespace 6 (NS_FILE). il_to varchar(255) binary NOT NULL default '', + UNIQUE KEY il_from(il_from,il_to), KEY (il_to) -); + +) /*$wgDBTableOptions*/; -- -- Stores (possibly gzipped) serialized objects with @@ -45,4 +66,5 @@ DROP TABLE IF EXISTS /*$wgDBprefix*/linkscc; CREATE TABLE /*$wgDBprefix*/linkscc ( lcc_pageid INT UNSIGNED NOT NULL UNIQUE KEY, lcc_cacheobj MEDIUMBLOB NOT NULL -); + +) /*$wgDBTableOptions*/;