aboutsummaryrefslogtreecommitdiffstats
path: root/sql/sqlite/patch-drop-cl_collation_ext.sql
blob: 7243b71c67311597f478b9edfea368cc0cd72ab0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
-- Source: sql/abstractSchemaChanges/patch-drop-cl_collation_ext.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__categorylinks AS
SELECT
  cl_from,
  cl_to,
  cl_sortkey,
  cl_sortkey_prefix,
  cl_timestamp,
  cl_collation,
  cl_type
FROM /*_*/categorylinks;
DROP TABLE /*_*/categorylinks;


CREATE TABLE /*_*/categorylinks (
    cl_from INTEGER UNSIGNED DEFAULT 0 NOT NULL,
    cl_to BLOB DEFAULT '' NOT NULL,
    cl_sortkey BLOB DEFAULT '' NOT NULL,
    cl_sortkey_prefix BLOB DEFAULT '' NOT NULL,
    cl_timestamp DATETIME NOT NULL,
    cl_collation BLOB DEFAULT '' NOT NULL,
    cl_type TEXT DEFAULT 'page' NOT NULL,
    PRIMARY KEY(cl_from, cl_to)
  );
INSERT INTO /*_*/categorylinks (
    cl_from, cl_to, cl_sortkey, cl_sortkey_prefix,
    cl_timestamp, cl_collation, cl_type
  )
SELECT
  cl_from,
  cl_to,
  cl_sortkey,
  cl_sortkey_prefix,
  cl_timestamp,
  cl_collation,
  cl_type
FROM
  /*_*/__temp__categorylinks;
DROP TABLE /*_*/__temp__categorylinks;

CREATE INDEX cl_sortkey ON /*_*/categorylinks (
    cl_to, cl_type, cl_sortkey, cl_from
  );

CREATE INDEX cl_timestamp ON /*_*/categorylinks (cl_to, cl_timestamp);