1 CREATE TABLE /*_*/iwlinks_tmp (
2 -- page_id of the referring page
3 iwl_from
int unsigned
NOT NULL default 0,
5 -- Interwiki prefix code of the target
6 iwl_prefix
varbinary(20) NOT NULL default '',
8 -- Title of the target, including namespace
9 iwl_title
varchar(255) binary NOT NULL default '',
10 PRIMARY KEY (iwl_from
,iwl_prefix
,iwl_title
)
11 ) /*$wgDBTableOptions*/;
13 INSERT INTO /*_*/iwlinks_tmp
14 SELECT * FROM /*_*/iwlinks
;
16 DROP TABLE /*_*/iwlinks
;
18 ALTER TABLE /*_*/iwlinks_tmp
RENAME TO /*_*/iwlinks
;
20 -- Index for ApiQueryIWBacklinks
21 CREATE INDEX /*i*/iwl_prefix_title_from
ON /*_*/iwlinks (iwl_prefix
, iwl_title
, iwl_from
);
23 -- Index for ApiQueryIWLinks
24 CREATE INDEX /*i*/iwl_prefix_from_title
ON /*_*/iwlinks (iwl_prefix
, iwl_from
, iwl_title
);