Debian Codegraph @

maintenance/sqlite/archives/patch-drop-page_restrictions-pr_user.sql

raw
1 -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 -- Source: maintenance/abstractSchemaChanges/patch-drop-page_restrictions-pr_user.json
3 -- Do not modify this file directly.
4 -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 CREATE TEMPORARY TABLE /*_*/__temp__page_restrictions AS
6 SELECT
7 pr_id,
8 pr_page,
9 pr_type,
10 pr_level,
11 pr_cascade,
12 pr_expiry
13 FROM /*_*/page_restrictions;
14 DROP TABLE /*_*/page_restrictions;
15
16
17 CREATE TABLE /*_*/page_restrictions (
18 pr_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
19 pr_page INTEGER NOT NULL, pr_type BLOB NOT NULL,
20 pr_level BLOB NOT NULL, pr_cascade SMALLINT NOT NULL,
21 pr_expiry BLOB DEFAULT NULL
22 );
23 INSERT INTO /*_*/page_restrictions (
24 pr_id, pr_page, pr_type, pr_level,
25 pr_cascade, pr_expiry
26 )
27 SELECT
28 pr_id,
29 pr_page,
30 pr_type,
31 pr_level,
32 pr_cascade,
33 pr_expiry
34 FROM
35 /*_*/__temp__page_restrictions;
36 DROP TABLE /*_*/__temp__page_restrictions;
37
38 CREATE UNIQUE INDEX pr_pagetype ON /*_*/page_restrictions (pr_page, pr_type);
39
40 CREATE INDEX pr_typelevel ON /*_*/page_restrictions (pr_type, pr_level);
41
42 CREATE INDEX pr_level ON /*_*/page_restrictions (pr_level);
43
44 CREATE INDEX pr_cascade ON /*_*/page_restrictions (pr_cascade);