Debian Codegraph @

maintenance/sqlite/archives/patch-templatelinks-tl_title-nullable.sql

raw
1 -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 -- Source: maintenance/abstractSchemaChanges/patch-templatelinks-tl_title-nullable.json
3 -- Do not modify this file directly.
4 -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 DROP INDEX tl_namespace;
6 DROP INDEX tl_backlinks_namespace;
7 DROP INDEX tl_target_id;
8 DROP INDEX tl_backlinks_namespace_target_id;
9 CREATE TEMPORARY TABLE /*_*/__temp__templatelinks AS
10 SELECT tl_from, tl_namespace, tl_title, tl_from_namespace, tl_target_id
11 FROM /*_*/templatelinks;
12 DROP TABLE /*_*/templatelinks;
13 CREATE TABLE /*_*/templatelinks ( tl_from INTEGER UNSIGNED DEFAULT 0 NOT NULL, tl_target_id BIGINT UNSIGNED NOT NULL, tl_namespace INTEGER DEFAULT 0 NOT NULL, tl_title BLOB DEFAULT '' NOT NULL, tl_from_namespace INTEGER DEFAULT 0 NOT NULL, PRIMARY KEY(tl_from, tl_target_id) );
14 INSERT INTO /*_*/templatelinks ( tl_from, tl_namespace, tl_title, tl_from_namespace, tl_target_id )
15 SELECT tl_from, tl_namespace, tl_title, tl_from_namespace, tl_target_id
16 FROM /*_*/__temp__templatelinks;
17 DROP TABLE /*_*/__temp__templatelinks;
18 CREATE INDEX tl_namespace ON /*_*/templatelinks (tl_namespace, tl_title, tl_from);
19 CREATE INDEX tl_backlinks_namespace ON /*_*/templatelinks ( tl_from_namespace, tl_namespace, tl_title, tl_from );
20 CREATE INDEX tl_target_id ON /*_*/templatelinks (tl_target_id, tl_from);
21 CREATE INDEX tl_backlinks_namespace_target_id ON /*_*/templatelinks ( tl_from_namespace, tl_target_id, tl_from );