| 1 |
CREATE TABLE /*_*/templatelinks_tmp ( |
| 2 |
tl_from INTEGER UNSIGNED DEFAULT 0 NOT NULL, |
| 3 |
tl_namespace INTEGER DEFAULT 0 NOT NULL, |
| 4 |
tl_title BLOB DEFAULT '' NOT NULL, |
| 5 |
tl_from_namespace INTEGER DEFAULT 0 NOT NULL, |
| 6 |
PRIMARY KEY(tl_from, tl_namespace, tl_title) |
| 7 |
); |
| 8 |
|
| 9 |
INSERT INTO /*_*/templatelinks_tmp |
| 10 |
SELECT tl_from, tl_namespace, tl_title, tl_from_namespace |
| 11 |
FROM /*_*/templatelinks; |
| 12 |
DROP TABLE /*_*/templatelinks; |
| 13 |
ALTER TABLE /*_*/templatelinks_tmp RENAME TO /*_*/templatelinks; |
| 14 |
|
| 15 |
CREATE INDEX tl_namespace ON /*_*/templatelinks (tl_namespace, tl_title, tl_from); |
| 16 |
|
| 17 |
CREATE INDEX tl_backlinks_namespace ON /*_*/templatelinks ( |
| 18 |
tl_from_namespace, tl_namespace, |
| 19 |
tl_title, tl_from |
| 20 |
); |