aboutsummaryrefslogtreecommitdiffstats
path: root/sql/sqlite/patch-templatelinks-tl_title-varbinary.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sqlite/patch-templatelinks-tl_title-varbinary.sql')
-rw-r--r--sql/sqlite/patch-templatelinks-tl_title-varbinary.sql20
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/sqlite/patch-templatelinks-tl_title-varbinary.sql b/sql/sqlite/patch-templatelinks-tl_title-varbinary.sql
new file mode 100644
index 000000000000..60039678baee
--- /dev/null
+++ b/sql/sqlite/patch-templatelinks-tl_title-varbinary.sql
@@ -0,0 +1,20 @@
+CREATE TABLE /*_*/templatelinks_tmp (
+ tl_from INTEGER UNSIGNED DEFAULT 0 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_namespace, tl_title)
+);
+
+INSERT INTO /*_*/templatelinks_tmp
+ SELECT tl_from, tl_namespace, tl_title, tl_from_namespace
+ FROM /*_*/templatelinks;
+DROP TABLE /*_*/templatelinks;
+ALTER TABLE /*_*/templatelinks_tmp RENAME TO /*_*/templatelinks;
+
+CREATE INDEX tl_namespace ON /*_*/templatelinks (tl_namespace, tl_title, tl_from);
+
+CREATE INDEX tl_backlinks_namespace ON /*_*/templatelinks (
+ tl_from_namespace, tl_namespace,
+ tl_title, tl_from
+);