Debian Codegraph @

maintenance/sqlite/archives/patch-page_restrictions-pr_page.sql

raw
1 -- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
2 -- Source: maintenance/abstractSchemaChanges/patch-page_restrictions-pr_page.json
3 -- Do not modify this file directly.
4 -- See https://www.mediawiki.org/wiki/Manual:Schema_changes
5 DROP INDEX pr_pagetype;
6 DROP INDEX pr_typelevel;
7 DROP INDEX pr_level;
8 DROP INDEX pr_cascade;
9 CREATE TEMPORARY TABLE /*_*/__temp__page_restrictions AS
10 SELECT pr_id, pr_page, pr_type, pr_level, pr_cascade, pr_expiry
11 FROM /*_*/page_restrictions;
12 DROP TABLE /*_*/page_restrictions;
13 CREATE TABLE /*_*/page_restrictions ( pr_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, pr_page INTEGER UNSIGNED NOT NULL, pr_type BLOB NOT NULL, pr_level BLOB NOT NULL, pr_cascade SMALLINT NOT NULL, pr_expiry BLOB DEFAULT NULL );
14 INSERT INTO /*_*/page_restrictions ( pr_id, pr_page, pr_type, pr_level, pr_cascade, pr_expiry )
15 SELECT pr_id, pr_page, pr_type, pr_level, pr_cascade, pr_expiry
16 FROM /*_*/__temp__page_restrictions;
17 DROP TABLE /*_*/__temp__page_restrictions;
18 CREATE UNIQUE INDEX pr_pagetype ON /*_*/page_restrictions (pr_page, pr_type);
19 CREATE INDEX pr_typelevel ON /*_*/page_restrictions (pr_type, pr_level);
20 CREATE INDEX pr_level ON /*_*/page_restrictions (pr_level);
21 CREATE INDEX pr_cascade ON /*_*/page_restrictions (pr_cascade);