aboutsummaryrefslogtreecommitdiffstats
path: root/sql/sqlite
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sqlite')
-rw-r--r--sql/sqlite/patch-change_tag-ct_rc_id.sql56
-rw-r--r--sql/sqlite/patch-change_tag-rename-indexes.sql60
-rw-r--r--sql/sqlite/patch-drop-cl_collation_ext.sql2
-rw-r--r--sql/sqlite/patch-drop-page_restrictions-pr_user.sql57
-rw-r--r--sql/sqlite/patch-drop-rev_page_id.sql75
-rw-r--r--sql/sqlite/patch-externallinks-drop-el_to.sql43
-rw-r--r--sql/sqlite/patch-externallinks-el_to_default.sql63
-rw-r--r--sql/sqlite/patch-externallinks-el_to_path.sql62
-rw-r--r--sql/sqlite/patch-filearchive-fa_size_to_bigint.sql105
-rw-r--r--sql/sqlite/patch-image-img_size_to_bigint.sql85
-rw-r--r--sql/sqlite/patch-ipblocks-ipb_id.sql104
-rw-r--r--sql/sqlite/patch-ipblocks_restrictions-ir_ipb_id.sql36
-rw-r--r--sql/sqlite/patch-ipblocks_restrictions-ir_value.sql36
-rw-r--r--sql/sqlite/patch-iwlinks-drop-iwl_prefix_from_title.sql2
-rw-r--r--sql/sqlite/patch-logging-rename-indexes.sql92
-rw-r--r--sql/sqlite/patch-objectcache-modtoken.sql10
-rw-r--r--sql/sqlite/patch-oldimage-oi_size_to_bigint.sql85
-rw-r--r--sql/sqlite/patch-oldimage-oi_timestamp.sql89
-rw-r--r--sql/sqlite/patch-page-drop-page_restrictions.sql81
-rw-r--r--sql/sqlite/patch-page-rename-name_title-index.sql81
-rw-r--r--sql/sqlite/patch-page_props-pp_page.sql45
-rw-r--r--sql/sqlite/patch-page_restrictions-pr_page.sql57
-rw-r--r--sql/sqlite/patch-pagelinks-drop-pl_title.sql2
-rw-r--r--sql/sqlite/patch-pagelinks-target_id.sql56
-rw-r--r--sql/sqlite/patch-recentchanges-rc_new_name_timestamp.sql137
-rw-r--r--sql/sqlite/patch-revision-cleanup.sql2
-rw-r--r--sql/sqlite/patch-revision-rename-index.sql79
-rw-r--r--sql/sqlite/patch-site_identifiers-rename-indexes.sql40
-rw-r--r--sql/sqlite/patch-sites-drop_indexes.sql2
-rw-r--r--sql/sqlite/patch-sites-rename-indexes.sql92
-rw-r--r--sql/sqlite/patch-templatelinks-drop-tl_title.sql47
-rw-r--r--sql/sqlite/patch-templatelinks-target_id.sql58
-rw-r--r--sql/sqlite/patch-templatelinks-tl_title-nullable.sql63
-rw-r--r--sql/sqlite/patch-uploadstash-us_size_to_bigint.sql89
-rw-r--r--sql/sqlite/patch-user-user_editcount.sql85
-rw-r--r--sql/sqlite/patch-user-user_is_temp.sql6
-rw-r--r--sql/sqlite/patch-user_autocreate_serial-uas_year.sql2
-rw-r--r--sql/sqlite/patch-user_properties-rename-index.sql36
-rw-r--r--sql/sqlite/patch-user_table-updates.sql85
-rw-r--r--sql/sqlite/patch-watchlist-namespace_title-rename-index.sql53
40 files changed, 1733 insertions, 527 deletions
diff --git a/sql/sqlite/patch-change_tag-ct_rc_id.sql b/sql/sqlite/patch-change_tag-ct_rc_id.sql
index 331d47d2b87e..29e84b525786 100644
--- a/sql/sqlite/patch-change_tag-ct_rc_id.sql
+++ b/sql/sqlite/patch-change_tag-ct_rc_id.sql
@@ -1,17 +1,47 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-change_tag-ct_rc_id.json
+-- Source: sql/abstractSchemaChanges/patch-change_tag-ct_rc_id.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__change_tag AS
-SELECT ct_id, ct_rc_id, ct_log_id, ct_rev_id, ct_params, ct_tag_id
-FROM /*_*/change_tag;
-DROP TABLE /*_*/change_tag;
-CREATE TABLE /*_*/change_tag ( ct_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, ct_rc_id BIGINT UNSIGNED DEFAULT NULL, ct_log_id INTEGER UNSIGNED DEFAULT NULL, ct_rev_id INTEGER UNSIGNED DEFAULT NULL, ct_params BLOB DEFAULT NULL, ct_tag_id INTEGER UNSIGNED NOT NULL );
-INSERT INTO /*_*/change_tag ( ct_id, ct_rc_id, ct_log_id, ct_rev_id, ct_params, ct_tag_id )
-SELECT ct_id, ct_rc_id, ct_log_id, ct_rev_id, ct_params, ct_tag_id
-FROM /*_*/__temp__change_tag;
-DROP TABLE /*_*/__temp__change_tag;
-CREATE UNIQUE INDEX ct_rc_tag_id ON /*_*/change_tag (ct_rc_id, ct_tag_id);
-CREATE UNIQUE INDEX ct_log_tag_id ON /*_*/change_tag (ct_log_id, ct_tag_id);
-CREATE UNIQUE INDEX ct_rev_tag_id ON /*_*/change_tag (ct_rev_id, ct_tag_id);
-CREATE INDEX ct_tag_id_id ON /*_*/change_tag ( ct_tag_id, ct_rc_id, ct_rev_id, ct_log_id ); \ No newline at end of file
+SELECT
+ ct_id,
+ ct_rc_id,
+ ct_log_id,
+ ct_rev_id,
+ ct_params,
+ ct_tag_id
+FROM /*_*/change_tag;
+DROP TABLE /*_*/change_tag;
+
+
+CREATE TABLE /*_*/change_tag (
+ ct_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ ct_rc_id BIGINT UNSIGNED DEFAULT NULL,
+ ct_log_id INTEGER UNSIGNED DEFAULT NULL,
+ ct_rev_id INTEGER UNSIGNED DEFAULT NULL,
+ ct_params BLOB DEFAULT NULL, ct_tag_id INTEGER UNSIGNED NOT NULL
+ );
+INSERT INTO /*_*/change_tag (
+ ct_id, ct_rc_id, ct_log_id, ct_rev_id,
+ ct_params, ct_tag_id
+ )
+SELECT
+ ct_id,
+ ct_rc_id,
+ ct_log_id,
+ ct_rev_id,
+ ct_params,
+ ct_tag_id
+FROM
+ /*_*/__temp__change_tag;
+DROP TABLE /*_*/__temp__change_tag;
+
+CREATE UNIQUE INDEX ct_rc_tag_id ON /*_*/change_tag (ct_rc_id, ct_tag_id);
+
+CREATE UNIQUE INDEX ct_log_tag_id ON /*_*/change_tag (ct_log_id, ct_tag_id);
+
+CREATE UNIQUE INDEX ct_rev_tag_id ON /*_*/change_tag (ct_rev_id, ct_tag_id);
+
+CREATE INDEX ct_tag_id_id ON /*_*/change_tag (
+ ct_tag_id, ct_rc_id, ct_rev_id, ct_log_id
+ );
diff --git a/sql/sqlite/patch-change_tag-rename-indexes.sql b/sql/sqlite/patch-change_tag-rename-indexes.sql
index 4da9f70cb499..0e5cb5c6f18c 100644
--- a/sql/sqlite/patch-change_tag-rename-indexes.sql
+++ b/sql/sqlite/patch-change_tag-rename-indexes.sql
@@ -1,21 +1,47 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-change_tag-rename-indexes.json
+-- Source: sql/abstractSchemaChanges/patch-change_tag-rename-indexes.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX change_tag_rc_tag_id;
-DROP INDEX change_tag_log_tag_id;
-DROP INDEX change_tag_rev_tag_id;
-DROP INDEX change_tag_tag_id_id;
CREATE TEMPORARY TABLE /*_*/__temp__change_tag AS
-SELECT ct_id, ct_rc_id, ct_log_id, ct_rev_id, ct_params, ct_tag_id
-FROM /*_*/change_tag;
-DROP TABLE /*_*/change_tag;
-CREATE TABLE /*_*/change_tag ( ct_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, ct_rc_id INTEGER UNSIGNED DEFAULT NULL, ct_log_id INTEGER UNSIGNED DEFAULT NULL, ct_rev_id INTEGER UNSIGNED DEFAULT NULL, ct_params BLOB DEFAULT NULL, ct_tag_id INTEGER UNSIGNED NOT NULL );
-INSERT INTO /*_*/change_tag ( ct_id, ct_rc_id, ct_log_id, ct_rev_id, ct_params, ct_tag_id )
-SELECT ct_id, ct_rc_id, ct_log_id, ct_rev_id, ct_params, ct_tag_id
-FROM /*_*/__temp__change_tag;
-DROP TABLE /*_*/__temp__change_tag;
-CREATE UNIQUE INDEX ct_rc_tag_id ON /*_*/change_tag (ct_rc_id, ct_tag_id);
-CREATE UNIQUE INDEX ct_log_tag_id ON /*_*/change_tag (ct_log_id, ct_tag_id);
-CREATE UNIQUE INDEX ct_rev_tag_id ON /*_*/change_tag (ct_rev_id, ct_tag_id);
-CREATE INDEX ct_tag_id_id ON /*_*/change_tag ( ct_tag_id, ct_rc_id, ct_rev_id, ct_log_id ); \ No newline at end of file
+SELECT
+ ct_id,
+ ct_rc_id,
+ ct_log_id,
+ ct_rev_id,
+ ct_params,
+ ct_tag_id
+FROM /*_*/change_tag;
+DROP TABLE /*_*/change_tag;
+
+
+CREATE TABLE /*_*/change_tag (
+ ct_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ ct_rc_id INTEGER UNSIGNED DEFAULT NULL,
+ ct_log_id INTEGER UNSIGNED DEFAULT NULL,
+ ct_rev_id INTEGER UNSIGNED DEFAULT NULL,
+ ct_params BLOB DEFAULT NULL, ct_tag_id INTEGER UNSIGNED NOT NULL
+ );
+INSERT INTO /*_*/change_tag (
+ ct_id, ct_rc_id, ct_log_id, ct_rev_id,
+ ct_params, ct_tag_id
+ )
+SELECT
+ ct_id,
+ ct_rc_id,
+ ct_log_id,
+ ct_rev_id,
+ ct_params,
+ ct_tag_id
+FROM
+ /*_*/__temp__change_tag;
+DROP TABLE /*_*/__temp__change_tag;
+
+CREATE UNIQUE INDEX ct_rc_tag_id ON /*_*/change_tag (ct_rc_id, ct_tag_id);
+
+CREATE UNIQUE INDEX ct_log_tag_id ON /*_*/change_tag (ct_log_id, ct_tag_id);
+
+CREATE UNIQUE INDEX ct_rev_tag_id ON /*_*/change_tag (ct_rev_id, ct_tag_id);
+
+CREATE INDEX ct_tag_id_id ON /*_*/change_tag (
+ ct_tag_id, ct_rc_id, ct_rev_id, ct_log_id
+ );
diff --git a/sql/sqlite/patch-drop-cl_collation_ext.sql b/sql/sqlite/patch-drop-cl_collation_ext.sql
index 2a8561080c7d..7243b71c6731 100644
--- a/sql/sqlite/patch-drop-cl_collation_ext.sql
+++ b/sql/sqlite/patch-drop-cl_collation_ext.sql
@@ -1,5 +1,5 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-drop-cl_collation_ext.json
+-- 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
diff --git a/sql/sqlite/patch-drop-page_restrictions-pr_user.sql b/sql/sqlite/patch-drop-page_restrictions-pr_user.sql
index f0880ae6797b..0971beddf76e 100644
--- a/sql/sqlite/patch-drop-page_restrictions-pr_user.sql
+++ b/sql/sqlite/patch-drop-page_restrictions-pr_user.sql
@@ -1,21 +1,44 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-drop-page_restrictions-pr_user.json
+-- Source: sql/abstractSchemaChanges/patch-drop-page_restrictions-pr_user.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX pr_pagetype;
-DROP INDEX pr_typelevel;
-DROP INDEX pr_level;
-DROP INDEX pr_cascade;
CREATE TEMPORARY TABLE /*_*/__temp__page_restrictions AS
-SELECT pr_id, pr_page, pr_type, pr_level, pr_cascade, pr_expiry
-FROM /*_*/page_restrictions;
-DROP TABLE /*_*/page_restrictions;
-CREATE TABLE /*_*/page_restrictions ( pr_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, pr_page INTEGER NOT NULL, pr_type BLOB NOT NULL, pr_level BLOB NOT NULL, pr_cascade SMALLINT NOT NULL, pr_expiry BLOB DEFAULT NULL );
-INSERT INTO /*_*/page_restrictions ( pr_id, pr_page, pr_type, pr_level, pr_cascade, pr_expiry )
-SELECT pr_id, pr_page, pr_type, pr_level, pr_cascade, pr_expiry
-FROM /*_*/__temp__page_restrictions;
-DROP TABLE /*_*/__temp__page_restrictions;
-CREATE UNIQUE INDEX pr_pagetype ON /*_*/page_restrictions (pr_page, pr_type);
-CREATE INDEX pr_typelevel ON /*_*/page_restrictions (pr_type, pr_level);
-CREATE INDEX pr_level ON /*_*/page_restrictions (pr_level);
-CREATE INDEX pr_cascade ON /*_*/page_restrictions (pr_cascade);
+SELECT
+ pr_id,
+ pr_page,
+ pr_type,
+ pr_level,
+ pr_cascade,
+ pr_expiry
+FROM /*_*/page_restrictions;
+DROP TABLE /*_*/page_restrictions;
+
+
+CREATE TABLE /*_*/page_restrictions (
+ pr_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ pr_page INTEGER NOT NULL, pr_type BLOB NOT NULL,
+ pr_level BLOB NOT NULL, pr_cascade SMALLINT NOT NULL,
+ pr_expiry BLOB DEFAULT NULL
+ );
+INSERT INTO /*_*/page_restrictions (
+ pr_id, pr_page, pr_type, pr_level,
+ pr_cascade, pr_expiry
+ )
+SELECT
+ pr_id,
+ pr_page,
+ pr_type,
+ pr_level,
+ pr_cascade,
+ pr_expiry
+FROM
+ /*_*/__temp__page_restrictions;
+DROP TABLE /*_*/__temp__page_restrictions;
+
+CREATE UNIQUE INDEX pr_pagetype ON /*_*/page_restrictions (pr_page, pr_type);
+
+CREATE INDEX pr_typelevel ON /*_*/page_restrictions (pr_type, pr_level);
+
+CREATE INDEX pr_level ON /*_*/page_restrictions (pr_level);
+
+CREATE INDEX pr_cascade ON /*_*/page_restrictions (pr_cascade);
diff --git a/sql/sqlite/patch-drop-rev_page_id.sql b/sql/sqlite/patch-drop-rev_page_id.sql
index 37683a787461..793a717fc5d1 100644
--- a/sql/sqlite/patch-drop-rev_page_id.sql
+++ b/sql/sqlite/patch-drop-rev_page_id.sql
@@ -1,22 +1,61 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-drop-rev_page_id.json
+-- Source: sql/abstractSchemaChanges/patch-drop-rev_page_id.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX rev_page_id;
-DROP INDEX rev_timestamp;
-DROP INDEX rev_page_timestamp;
-DROP INDEX rev_actor_timestamp;
-DROP INDEX rev_page_actor_timestamp;
CREATE TEMPORARY TABLE /*_*/__temp__revision AS
-SELECT rev_id, rev_page, rev_comment_id, rev_actor, rev_timestamp, rev_minor_edit, rev_deleted, rev_len, rev_parent_id, rev_sha1
-FROM /*_*/revision;
-DROP TABLE /*_*/revision;
-CREATE TABLE /*_*/revision ( rev_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, rev_page INTEGER UNSIGNED NOT NULL, rev_comment_id BIGINT UNSIGNED DEFAULT 0 NOT NULL, rev_actor BIGINT UNSIGNED DEFAULT 0 NOT NULL, rev_timestamp BLOB NOT NULL, rev_minor_edit SMALLINT UNSIGNED DEFAULT 0 NOT NULL, rev_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL, rev_len INTEGER UNSIGNED DEFAULT NULL, rev_parent_id INTEGER UNSIGNED DEFAULT NULL, rev_sha1 BLOB DEFAULT '' NOT NULL );
-INSERT INTO /*_*/revision ( rev_id, rev_page, rev_comment_id, rev_actor, rev_timestamp, rev_minor_edit, rev_deleted, rev_len, rev_parent_id, rev_sha1 )
-SELECT rev_id, rev_page, rev_comment_id, rev_actor, rev_timestamp, rev_minor_edit, rev_deleted, rev_len, rev_parent_id, rev_sha1
-FROM /*_*/__temp__revision;
-DROP TABLE /*_*/__temp__revision;
-CREATE INDEX rev_timestamp ON /*_*/revision (rev_timestamp);
-CREATE INDEX rev_page_timestamp ON /*_*/revision (rev_page, rev_timestamp);
-CREATE INDEX rev_actor_timestamp ON /*_*/revision (rev_actor, rev_timestamp, rev_id);
-CREATE INDEX rev_page_actor_timestamp ON /*_*/revision ( rev_page, rev_actor, rev_timestamp ); \ No newline at end of file
+SELECT
+ rev_id,
+ rev_page,
+ rev_comment_id,
+ rev_actor,
+ rev_timestamp,
+ rev_minor_edit,
+ rev_deleted,
+ rev_len,
+ rev_parent_id,
+ rev_sha1
+FROM /*_*/revision;
+DROP TABLE /*_*/revision;
+
+
+CREATE TABLE /*_*/revision (
+ rev_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ rev_page INTEGER UNSIGNED NOT NULL,
+ rev_comment_id BIGINT UNSIGNED DEFAULT 0 NOT NULL,
+ rev_actor BIGINT UNSIGNED DEFAULT 0 NOT NULL,
+ rev_timestamp BLOB NOT NULL, rev_minor_edit SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ rev_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ rev_len INTEGER UNSIGNED DEFAULT NULL,
+ rev_parent_id INTEGER UNSIGNED DEFAULT NULL,
+ rev_sha1 BLOB DEFAULT '' NOT NULL
+ );
+INSERT INTO /*_*/revision (
+ rev_id, rev_page, rev_comment_id,
+ rev_actor, rev_timestamp, rev_minor_edit,
+ rev_deleted, rev_len, rev_parent_id,
+ rev_sha1
+ )
+SELECT
+ rev_id,
+ rev_page,
+ rev_comment_id,
+ rev_actor,
+ rev_timestamp,
+ rev_minor_edit,
+ rev_deleted,
+ rev_len,
+ rev_parent_id,
+ rev_sha1
+FROM
+ /*_*/__temp__revision;
+DROP TABLE /*_*/__temp__revision;
+
+CREATE INDEX rev_timestamp ON /*_*/revision (rev_timestamp);
+
+CREATE INDEX rev_page_timestamp ON /*_*/revision (rev_page, rev_timestamp);
+
+CREATE INDEX rev_actor_timestamp ON /*_*/revision (rev_actor, rev_timestamp, rev_id);
+
+CREATE INDEX rev_page_actor_timestamp ON /*_*/revision (
+ rev_page, rev_actor, rev_timestamp
+ );
diff --git a/sql/sqlite/patch-externallinks-drop-el_to.sql b/sql/sqlite/patch-externallinks-drop-el_to.sql
index d8041c8c03fd..e0d4b63bc3f6 100644
--- a/sql/sqlite/patch-externallinks-drop-el_to.sql
+++ b/sql/sqlite/patch-externallinks-drop-el_to.sql
@@ -1,15 +1,36 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-externallinks-drop-el_to.json
+-- Source: sql/abstractSchemaChanges/patch-externallinks-drop-el_to.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__externallinks AS
-SELECT el_id, el_from, el_to_domain_index, el_to_path
-FROM /*_*/externallinks;
-DROP TABLE /*_*/externallinks;
-CREATE TABLE /*_*/externallinks ( el_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, el_from INTEGER UNSIGNED DEFAULT 0 NOT NULL, el_to_domain_index BLOB DEFAULT '' NOT NULL, el_to_path BLOB DEFAULT NULL );
-INSERT INTO /*_*/externallinks ( el_id, el_from, el_to_domain_index, el_to_path )
-SELECT el_id, el_from, el_to_domain_index, el_to_path
-FROM /*_*/__temp__externallinks;
-DROP TABLE /*_*/__temp__externallinks;
-CREATE INDEX el_from ON /*_*/externallinks (el_from);
-CREATE INDEX el_to_domain_index_to_path ON /*_*/externallinks (el_to_domain_index, el_to_path); \ No newline at end of file
+SELECT
+ el_id,
+ el_from,
+ el_to_domain_index,
+ el_to_path
+FROM /*_*/externallinks;
+DROP TABLE /*_*/externallinks;
+
+
+CREATE TABLE /*_*/externallinks (
+ el_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ el_from INTEGER UNSIGNED DEFAULT 0 NOT NULL,
+ el_to_domain_index BLOB DEFAULT '' NOT NULL,
+ el_to_path BLOB DEFAULT NULL
+ );
+INSERT INTO /*_*/externallinks (
+ el_id, el_from, el_to_domain_index,
+ el_to_path
+ )
+SELECT
+ el_id,
+ el_from,
+ el_to_domain_index,
+ el_to_path
+FROM
+ /*_*/__temp__externallinks;
+DROP TABLE /*_*/__temp__externallinks;
+
+CREATE INDEX el_from ON /*_*/externallinks (el_from);
+
+CREATE INDEX el_to_domain_index_to_path ON /*_*/externallinks (el_to_domain_index, el_to_path);
diff --git a/sql/sqlite/patch-externallinks-el_to_default.sql b/sql/sqlite/patch-externallinks-el_to_default.sql
index eb00d698701f..9e475c12b9f4 100644
--- a/sql/sqlite/patch-externallinks-el_to_default.sql
+++ b/sql/sqlite/patch-externallinks-el_to_default.sql
@@ -1,19 +1,52 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-externallinks-el_to_default.json
+-- Source: sql/abstractSchemaChanges/patch-externallinks-el_to_default.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__externallinks AS
-SELECT el_id, el_from, el_to, el_index, el_index_60, el_to_domain_index, el_to_path
-FROM /*_*/externallinks;
-DROP TABLE /*_*/externallinks;
-CREATE TABLE /*_*/externallinks ( el_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, el_from INTEGER UNSIGNED DEFAULT 0 NOT NULL, el_to BLOB DEFAULT '', el_index BLOB DEFAULT '', el_index_60 BLOB DEFAULT '' NOT NULL, el_to_domain_index BLOB DEFAULT '' NOT NULL, el_to_path BLOB DEFAULT NULL );
-INSERT INTO /*_*/externallinks ( el_id, el_from, el_to, el_index, el_index_60, el_to_domain_index, el_to_path )
-SELECT el_id, el_from, el_to, el_index, el_index_60, el_to_domain_index, el_to_path
-FROM /*_*/__temp__externallinks;
-DROP TABLE /*_*/__temp__externallinks;
-CREATE INDEX el_from ON /*_*/externallinks (el_from);
-CREATE INDEX el_to ON /*_*/externallinks (el_to, el_from);
-CREATE INDEX el_index ON /*_*/externallinks (el_index);
-CREATE INDEX el_index_60 ON /*_*/externallinks (el_index_60, el_id);
-CREATE INDEX el_from_index_60 ON /*_*/externallinks (el_from, el_index_60, el_id);
-CREATE INDEX el_to_domain_index_to_path ON /*_*/externallinks (el_to_domain_index, el_to_path); \ No newline at end of file
+SELECT
+ el_id,
+ el_from,
+ el_to,
+ el_index,
+ el_index_60,
+ el_to_domain_index,
+ el_to_path
+FROM /*_*/externallinks;
+DROP TABLE /*_*/externallinks;
+
+
+CREATE TABLE /*_*/externallinks (
+ el_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ el_from INTEGER UNSIGNED DEFAULT 0 NOT NULL,
+ el_to BLOB DEFAULT '', el_index BLOB DEFAULT '',
+ el_index_60 BLOB DEFAULT '' NOT NULL,
+ el_to_domain_index BLOB DEFAULT '' NOT NULL,
+ el_to_path BLOB DEFAULT NULL
+ );
+INSERT INTO /*_*/externallinks (
+ el_id, el_from, el_to, el_index, el_index_60,
+ el_to_domain_index, el_to_path
+ )
+SELECT
+ el_id,
+ el_from,
+ el_to,
+ el_index,
+ el_index_60,
+ el_to_domain_index,
+ el_to_path
+FROM
+ /*_*/__temp__externallinks;
+DROP TABLE /*_*/__temp__externallinks;
+
+CREATE INDEX el_from ON /*_*/externallinks (el_from);
+
+CREATE INDEX el_to ON /*_*/externallinks (el_to, el_from);
+
+CREATE INDEX el_index ON /*_*/externallinks (el_index);
+
+CREATE INDEX el_index_60 ON /*_*/externallinks (el_index_60, el_id);
+
+CREATE INDEX el_from_index_60 ON /*_*/externallinks (el_from, el_index_60, el_id);
+
+CREATE INDEX el_to_domain_index_to_path ON /*_*/externallinks (el_to_domain_index, el_to_path);
diff --git a/sql/sqlite/patch-externallinks-el_to_path.sql b/sql/sqlite/patch-externallinks-el_to_path.sql
index 6ab5b1257ca8..9c4207361a89 100644
--- a/sql/sqlite/patch-externallinks-el_to_path.sql
+++ b/sql/sqlite/patch-externallinks-el_to_path.sql
@@ -1,24 +1,46 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-externallinks-el_to_path.json
+-- Source: sql/abstractSchemaChanges/patch-externallinks-el_to_path.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX el_from;
-DROP INDEX el_to;
-DROP INDEX el_index;
-DROP INDEX el_index_60;
-DROP INDEX el_from_index_60;
CREATE TEMPORARY TABLE /*_*/__temp__externallinks AS
-SELECT el_id, el_from, el_to, el_index, el_index_60
-FROM /*_*/externallinks;
-DROP TABLE /*_*/externallinks;
-CREATE TABLE /*_*/externallinks ( el_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, el_from INTEGER UNSIGNED DEFAULT 0 NOT NULL, el_to BLOB NOT NULL, el_index BLOB NOT NULL, el_index_60 BLOB NOT NULL, el_to_domain_index BLOB DEFAULT '' NOT NULL, el_to_path BLOB DEFAULT NULL );
-INSERT INTO /*_*/externallinks ( el_id, el_from, el_to, el_index, el_index_60 )
-SELECT el_id, el_from, el_to, el_index, el_index_60
-FROM /*_*/__temp__externallinks;
-DROP TABLE /*_*/__temp__externallinks;
-CREATE INDEX el_from ON /*_*/externallinks (el_from);
-CREATE INDEX el_to ON /*_*/externallinks (el_to, el_from);
-CREATE INDEX el_index ON /*_*/externallinks (el_index);
-CREATE INDEX el_index_60 ON /*_*/externallinks (el_index_60, el_id);
-CREATE INDEX el_from_index_60 ON /*_*/externallinks (el_from, el_index_60, el_id);
-CREATE INDEX el_to_domain_index_to_path ON /*_*/externallinks (el_to_domain_index, el_to_path); \ No newline at end of file
+SELECT
+ el_id,
+ el_from,
+ el_to,
+ el_index,
+ el_index_60
+FROM /*_*/externallinks;
+DROP TABLE /*_*/externallinks;
+
+
+CREATE TABLE /*_*/externallinks (
+ el_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ el_from INTEGER UNSIGNED DEFAULT 0 NOT NULL,
+ el_to BLOB NOT NULL, el_index BLOB NOT NULL,
+ el_index_60 BLOB NOT NULL, el_to_domain_index BLOB DEFAULT '' NOT NULL,
+ el_to_path BLOB DEFAULT NULL
+ );
+INSERT INTO /*_*/externallinks (
+ el_id, el_from, el_to, el_index, el_index_60
+ )
+SELECT
+ el_id,
+ el_from,
+ el_to,
+ el_index,
+ el_index_60
+FROM
+ /*_*/__temp__externallinks;
+DROP TABLE /*_*/__temp__externallinks;
+
+CREATE INDEX el_from ON /*_*/externallinks (el_from);
+
+CREATE INDEX el_to ON /*_*/externallinks (el_to, el_from);
+
+CREATE INDEX el_index ON /*_*/externallinks (el_index);
+
+CREATE INDEX el_index_60 ON /*_*/externallinks (el_index_60, el_id);
+
+CREATE INDEX el_from_index_60 ON /*_*/externallinks (el_from, el_index_60, el_id);
+
+CREATE INDEX el_to_domain_index_to_path ON /*_*/externallinks (el_to_domain_index, el_to_path);
diff --git a/sql/sqlite/patch-filearchive-fa_size_to_bigint.sql b/sql/sqlite/patch-filearchive-fa_size_to_bigint.sql
index c350c1da210f..c199b0912ee3 100644
--- a/sql/sqlite/patch-filearchive-fa_size_to_bigint.sql
+++ b/sql/sqlite/patch-filearchive-fa_size_to_bigint.sql
@@ -1,18 +1,95 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: abstractSchemaChanges/patch-filearchive-fa_size_to_bigint.json
+-- Source: sql/abstractSchemaChanges/patch-filearchive-fa_size_to_bigint.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__filearchive AS
-SELECT fa_id, fa_name, fa_archive_name, fa_storage_group, fa_storage_key, fa_deleted_user, fa_deleted_timestamp, fa_deleted_reason_id, fa_size, fa_width, fa_height, fa_metadata, fa_bits, fa_media_type, fa_major_mime, fa_minor_mime, fa_description_id, fa_actor, fa_timestamp, fa_deleted, fa_sha1
-FROM /*_*/filearchive;
-DROP TABLE /*_*/filearchive;
-CREATE TABLE /*_*/filearchive ( fa_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, fa_name BLOB DEFAULT '' NOT NULL, fa_archive_name BLOB DEFAULT '', fa_storage_group BLOB DEFAULT NULL, fa_storage_key BLOB DEFAULT '', fa_deleted_user INTEGER DEFAULT NULL, fa_deleted_timestamp BLOB DEFAULT NULL, fa_deleted_reason_id BIGINT UNSIGNED NOT NULL, fa_size BIGINT UNSIGNED DEFAULT 0, fa_width INTEGER DEFAULT 0, fa_height INTEGER DEFAULT 0, fa_metadata BLOB DEFAULT NULL, fa_bits INTEGER DEFAULT 0, fa_media_type TEXT DEFAULT NULL, fa_major_mime TEXT DEFAULT 'unknown', fa_minor_mime BLOB DEFAULT 'unknown', fa_description_id BIGINT UNSIGNED NOT NULL, fa_actor BIGINT UNSIGNED NOT NULL, fa_timestamp BLOB DEFAULT NULL, fa_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL, fa_sha1 BLOB DEFAULT '' NOT NULL );
-INSERT INTO /*_*/filearchive ( fa_id, fa_name, fa_archive_name, fa_storage_group, fa_storage_key, fa_deleted_user, fa_deleted_timestamp, fa_deleted_reason_id, fa_size, fa_width, fa_height, fa_metadata, fa_bits, fa_media_type, fa_major_mime, fa_minor_mime, fa_description_id, fa_actor, fa_timestamp, fa_deleted, fa_sha1 )
-SELECT fa_id, fa_name, fa_archive_name, fa_storage_group, fa_storage_key, fa_deleted_user, fa_deleted_timestamp, fa_deleted_reason_id, fa_size, fa_width, fa_height, fa_metadata, fa_bits, fa_media_type, fa_major_mime, fa_minor_mime, fa_description_id, fa_actor, fa_timestamp, fa_deleted, fa_sha1
-FROM /*_*/__temp__filearchive;
-DROP TABLE /*_*/__temp__filearchive;
-CREATE INDEX fa_name ON /*_*/filearchive (fa_name, fa_timestamp);
-CREATE INDEX fa_storage_group ON /*_*/filearchive ( fa_storage_group, fa_storage_key );
-CREATE INDEX fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp);
-CREATE INDEX fa_actor_timestamp ON /*_*/filearchive (fa_actor, fa_timestamp);
-CREATE INDEX fa_sha1 ON /*_*/filearchive (fa_sha1); \ No newline at end of file
+SELECT
+ fa_id,
+ fa_name,
+ fa_archive_name,
+ fa_storage_group,
+ fa_storage_key,
+ fa_deleted_user,
+ fa_deleted_timestamp,
+ fa_deleted_reason_id,
+ fa_size,
+ fa_width,
+ fa_height,
+ fa_metadata,
+ fa_bits,
+ fa_media_type,
+ fa_major_mime,
+ fa_minor_mime,
+ fa_description_id,
+ fa_actor,
+ fa_timestamp,
+ fa_deleted,
+ fa_sha1
+FROM /*_*/filearchive;
+DROP TABLE /*_*/filearchive;
+
+
+CREATE TABLE /*_*/filearchive (
+ fa_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ fa_name BLOB DEFAULT '' NOT NULL, fa_archive_name BLOB DEFAULT '',
+ fa_storage_group BLOB DEFAULT NULL,
+ fa_storage_key BLOB DEFAULT '', fa_deleted_user INTEGER DEFAULT NULL,
+ fa_deleted_timestamp BLOB DEFAULT NULL,
+ fa_deleted_reason_id BIGINT UNSIGNED NOT NULL,
+ fa_size BIGINT UNSIGNED DEFAULT 0,
+ fa_width INTEGER DEFAULT 0, fa_height INTEGER DEFAULT 0,
+ fa_metadata BLOB DEFAULT NULL, fa_bits INTEGER DEFAULT 0,
+ fa_media_type TEXT DEFAULT NULL, fa_major_mime TEXT DEFAULT 'unknown',
+ fa_minor_mime BLOB DEFAULT 'unknown',
+ fa_description_id BIGINT UNSIGNED NOT NULL,
+ fa_actor BIGINT UNSIGNED NOT NULL,
+ fa_timestamp BLOB DEFAULT NULL, fa_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ fa_sha1 BLOB DEFAULT '' NOT NULL
+ );
+INSERT INTO /*_*/filearchive (
+ fa_id, fa_name, fa_archive_name, fa_storage_group,
+ fa_storage_key, fa_deleted_user,
+ fa_deleted_timestamp, fa_deleted_reason_id,
+ fa_size, fa_width, fa_height, fa_metadata,
+ fa_bits, fa_media_type, fa_major_mime,
+ fa_minor_mime, fa_description_id,
+ fa_actor, fa_timestamp, fa_deleted,
+ fa_sha1
+ )
+SELECT
+ fa_id,
+ fa_name,
+ fa_archive_name,
+ fa_storage_group,
+ fa_storage_key,
+ fa_deleted_user,
+ fa_deleted_timestamp,
+ fa_deleted_reason_id,
+ fa_size,
+ fa_width,
+ fa_height,
+ fa_metadata,
+ fa_bits,
+ fa_media_type,
+ fa_major_mime,
+ fa_minor_mime,
+ fa_description_id,
+ fa_actor,
+ fa_timestamp,
+ fa_deleted,
+ fa_sha1
+FROM
+ /*_*/__temp__filearchive;
+DROP TABLE /*_*/__temp__filearchive;
+
+CREATE INDEX fa_name ON /*_*/filearchive (fa_name, fa_timestamp);
+
+CREATE INDEX fa_storage_group ON /*_*/filearchive (
+ fa_storage_group, fa_storage_key
+ );
+
+CREATE INDEX fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp);
+
+CREATE INDEX fa_actor_timestamp ON /*_*/filearchive (fa_actor, fa_timestamp);
+
+CREATE INDEX fa_sha1 ON /*_*/filearchive (fa_sha1);
diff --git a/sql/sqlite/patch-image-img_size_to_bigint.sql b/sql/sqlite/patch-image-img_size_to_bigint.sql
index 05fa7871d3c2..29e6e20685b9 100644
--- a/sql/sqlite/patch-image-img_size_to_bigint.sql
+++ b/sql/sqlite/patch-image-img_size_to_bigint.sql
@@ -1,18 +1,75 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: abstractSchemaChanges/patch-image-img_size_to_bigint.json
+-- Source: sql/abstractSchemaChanges/patch-image-img_size_to_bigint.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__image AS
-SELECT img_name, img_size, img_width, img_height, img_metadata, img_bits, img_media_type, img_major_mime, img_minor_mime, img_description_id, img_actor, img_timestamp, img_sha1
-FROM /*_*/image;
-DROP TABLE /*_*/image;
-CREATE TABLE /*_*/image ( img_name BLOB DEFAULT '' NOT NULL, img_size BIGINT UNSIGNED DEFAULT 0 NOT NULL, img_width INTEGER DEFAULT 0 NOT NULL, img_height INTEGER DEFAULT 0 NOT NULL, img_metadata BLOB NOT NULL, img_bits INTEGER DEFAULT 0 NOT NULL, img_media_type TEXT DEFAULT NULL, img_major_mime TEXT DEFAULT 'unknown' NOT NULL, img_minor_mime BLOB DEFAULT 'unknown' NOT NULL, img_description_id BIGINT UNSIGNED NOT NULL, img_actor BIGINT UNSIGNED NOT NULL, img_timestamp BLOB NOT NULL, img_sha1 BLOB DEFAULT '' NOT NULL, PRIMARY KEY(img_name) );
-INSERT INTO /*_*/image ( img_name, img_size, img_width, img_height, img_metadata, img_bits, img_media_type, img_major_mime, img_minor_mime, img_description_id, img_actor, img_timestamp, img_sha1 )
-SELECT img_name, img_size, img_width, img_height, img_metadata, img_bits, img_media_type, img_major_mime, img_minor_mime, img_description_id, img_actor, img_timestamp, img_sha1
-FROM /*_*/__temp__image;
-DROP TABLE /*_*/__temp__image;
-CREATE INDEX img_actor_timestamp ON /*_*/image (img_actor, img_timestamp);
-CREATE INDEX img_size ON /*_*/image (img_size);
-CREATE INDEX img_timestamp ON /*_*/image (img_timestamp);
-CREATE INDEX img_sha1 ON /*_*/image (img_sha1);
-CREATE INDEX img_media_mime ON /*_*/image ( img_media_type, img_major_mime, img_minor_mime ); \ No newline at end of file
+SELECT
+ img_name,
+ img_size,
+ img_width,
+ img_height,
+ img_metadata,
+ img_bits,
+ img_media_type,
+ img_major_mime,
+ img_minor_mime,
+ img_description_id,
+ img_actor,
+ img_timestamp,
+ img_sha1
+FROM /*_*/image;
+DROP TABLE /*_*/image;
+
+
+CREATE TABLE /*_*/image (
+ img_name BLOB DEFAULT '' NOT NULL,
+ img_size BIGINT UNSIGNED DEFAULT 0 NOT NULL,
+ img_width INTEGER DEFAULT 0 NOT NULL,
+ img_height INTEGER DEFAULT 0 NOT NULL,
+ img_metadata BLOB NOT NULL,
+ img_bits INTEGER DEFAULT 0 NOT NULL,
+ img_media_type TEXT DEFAULT NULL,
+ img_major_mime TEXT DEFAULT 'unknown' NOT NULL,
+ img_minor_mime BLOB DEFAULT 'unknown' NOT NULL,
+ img_description_id BIGINT UNSIGNED NOT NULL,
+ img_actor BIGINT UNSIGNED NOT NULL,
+ img_timestamp BLOB NOT NULL,
+ img_sha1 BLOB DEFAULT '' NOT NULL,
+ PRIMARY KEY(img_name)
+ );
+INSERT INTO /*_*/image (
+ img_name, img_size, img_width, img_height,
+ img_metadata, img_bits, img_media_type,
+ img_major_mime, img_minor_mime,
+ img_description_id, img_actor, img_timestamp,
+ img_sha1
+ )
+SELECT
+ img_name,
+ img_size,
+ img_width,
+ img_height,
+ img_metadata,
+ img_bits,
+ img_media_type,
+ img_major_mime,
+ img_minor_mime,
+ img_description_id,
+ img_actor,
+ img_timestamp,
+ img_sha1
+FROM
+ /*_*/__temp__image;
+DROP TABLE /*_*/__temp__image;
+
+CREATE INDEX img_actor_timestamp ON /*_*/image (img_actor, img_timestamp);
+
+CREATE INDEX img_size ON /*_*/image (img_size);
+
+CREATE INDEX img_timestamp ON /*_*/image (img_timestamp);
+
+CREATE INDEX img_sha1 ON /*_*/image (img_sha1);
+
+CREATE INDEX img_media_mime ON /*_*/image (
+ img_media_type, img_major_mime, img_minor_mime
+ );
diff --git a/sql/sqlite/patch-ipblocks-ipb_id.sql b/sql/sqlite/patch-ipblocks-ipb_id.sql
index 832214f735d9..1c475126b638 100644
--- a/sql/sqlite/patch-ipblocks-ipb_id.sql
+++ b/sql/sqlite/patch-ipblocks-ipb_id.sql
@@ -1,25 +1,87 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-ipblocks-ipb_id.json
+-- Source: sql/abstractSchemaChanges/patch-ipblocks-ipb_id.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX ipb_address_unique;
-DROP INDEX ipb_user;
-DROP INDEX ipb_range;
-DROP INDEX ipb_timestamp;
-DROP INDEX ipb_expiry;
-DROP INDEX ipb_parent_block_id;
CREATE TEMPORARY TABLE /*_*/__temp__ipblocks AS
-SELECT ipb_id, ipb_address, ipb_user, ipb_by_actor, ipb_reason_id, ipb_timestamp, ipb_auto, ipb_anon_only, ipb_create_account, ipb_enable_autoblock, ipb_expiry, ipb_range_start, ipb_range_end, ipb_deleted, ipb_block_email, ipb_allow_usertalk, ipb_parent_block_id, ipb_sitewide
-FROM /*_*/ipblocks;
-DROP TABLE /*_*/ipblocks;
-CREATE TABLE /*_*/ipblocks ( ipb_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, ipb_address BLOB NOT NULL, ipb_user INTEGER UNSIGNED DEFAULT 0 NOT NULL, ipb_by_actor BIGINT UNSIGNED NOT NULL, ipb_reason_id BIGINT UNSIGNED NOT NULL, ipb_timestamp BLOB NOT NULL, ipb_auto SMALLINT DEFAULT 0 NOT NULL, ipb_anon_only SMALLINT DEFAULT 0 NOT NULL, ipb_create_account SMALLINT DEFAULT 1 NOT NULL, ipb_enable_autoblock SMALLINT DEFAULT 1 NOT NULL, ipb_expiry BLOB NOT NULL, ipb_range_start BLOB NOT NULL, ipb_range_end BLOB NOT NULL, ipb_deleted SMALLINT DEFAULT 0 NOT NULL, ipb_block_email SMALLINT DEFAULT 0 NOT NULL, ipb_allow_usertalk SMALLINT DEFAULT 0 NOT NULL, ipb_parent_block_id INTEGER UNSIGNED DEFAULT NULL, ipb_sitewide SMALLINT DEFAULT 1 NOT NULL );
-INSERT INTO /*_*/ipblocks ( ipb_id, ipb_address, ipb_user, ipb_by_actor, ipb_reason_id, ipb_timestamp, ipb_auto, ipb_anon_only, ipb_create_account, ipb_enable_autoblock, ipb_expiry, ipb_range_start, ipb_range_end, ipb_deleted, ipb_block_email, ipb_allow_usertalk, ipb_parent_block_id, ipb_sitewide )
-SELECT ipb_id, ipb_address, ipb_user, ipb_by_actor, ipb_reason_id, ipb_timestamp, ipb_auto, ipb_anon_only, ipb_create_account, ipb_enable_autoblock, ipb_expiry, ipb_range_start, ipb_range_end, ipb_deleted, ipb_block_email, ipb_allow_usertalk, ipb_parent_block_id, ipb_sitewide
-FROM /*_*/__temp__ipblocks;
-DROP TABLE /*_*/__temp__ipblocks;
-CREATE UNIQUE INDEX ipb_address_unique ON /*_*/ipblocks (ipb_address, ipb_user, ipb_auto);
-CREATE INDEX ipb_user ON /*_*/ipblocks (ipb_user);
-CREATE INDEX ipb_range ON /*_*/ipblocks (ipb_range_start, ipb_range_end);
-CREATE INDEX ipb_timestamp ON /*_*/ipblocks (ipb_timestamp);
-CREATE INDEX ipb_expiry ON /*_*/ipblocks (ipb_expiry);
-CREATE INDEX ipb_parent_block_id ON /*_*/ipblocks (ipb_parent_block_id); \ No newline at end of file
+SELECT
+ ipb_id,
+ ipb_address,
+ ipb_user,
+ ipb_by_actor,
+ ipb_reason_id,
+ ipb_timestamp,
+ ipb_auto,
+ ipb_anon_only,
+ ipb_create_account,
+ ipb_enable_autoblock,
+ ipb_expiry,
+ ipb_range_start,
+ ipb_range_end,
+ ipb_deleted,
+ ipb_block_email,
+ ipb_allow_usertalk,
+ ipb_parent_block_id,
+ ipb_sitewide
+FROM /*_*/ipblocks;
+DROP TABLE /*_*/ipblocks;
+
+
+CREATE TABLE /*_*/ipblocks (
+ ipb_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ ipb_address BLOB NOT NULL, ipb_user INTEGER UNSIGNED DEFAULT 0 NOT NULL,
+ ipb_by_actor BIGINT UNSIGNED NOT NULL,
+ ipb_reason_id BIGINT UNSIGNED NOT NULL,
+ ipb_timestamp BLOB NOT NULL, ipb_auto SMALLINT DEFAULT 0 NOT NULL,
+ ipb_anon_only SMALLINT DEFAULT 0 NOT NULL,
+ ipb_create_account SMALLINT DEFAULT 1 NOT NULL,
+ ipb_enable_autoblock SMALLINT DEFAULT 1 NOT NULL,
+ ipb_expiry BLOB NOT NULL, ipb_range_start BLOB NOT NULL,
+ ipb_range_end BLOB NOT NULL, ipb_deleted SMALLINT DEFAULT 0 NOT NULL,
+ ipb_block_email SMALLINT DEFAULT 0 NOT NULL,
+ ipb_allow_usertalk SMALLINT DEFAULT 0 NOT NULL,
+ ipb_parent_block_id INTEGER UNSIGNED DEFAULT NULL,
+ ipb_sitewide SMALLINT DEFAULT 1 NOT NULL
+ );
+INSERT INTO /*_*/ipblocks (
+ ipb_id, ipb_address, ipb_user, ipb_by_actor,
+ ipb_reason_id, ipb_timestamp, ipb_auto,
+ ipb_anon_only, ipb_create_account,
+ ipb_enable_autoblock, ipb_expiry,
+ ipb_range_start, ipb_range_end,
+ ipb_deleted, ipb_block_email, ipb_allow_usertalk,
+ ipb_parent_block_id, ipb_sitewide
+ )
+SELECT
+ ipb_id,
+ ipb_address,
+ ipb_user,
+ ipb_by_actor,
+ ipb_reason_id,
+ ipb_timestamp,
+ ipb_auto,
+ ipb_anon_only,
+ ipb_create_account,
+ ipb_enable_autoblock,
+ ipb_expiry,
+ ipb_range_start,
+ ipb_range_end,
+ ipb_deleted,
+ ipb_block_email,
+ ipb_allow_usertalk,
+ ipb_parent_block_id,
+ ipb_sitewide
+FROM
+ /*_*/__temp__ipblocks;
+DROP TABLE /*_*/__temp__ipblocks;
+
+CREATE UNIQUE INDEX ipb_address_unique ON /*_*/ipblocks (ipb_address, ipb_user, ipb_auto);
+
+CREATE INDEX ipb_user ON /*_*/ipblocks (ipb_user);
+
+CREATE INDEX ipb_range ON /*_*/ipblocks (ipb_range_start, ipb_range_end);
+
+CREATE INDEX ipb_timestamp ON /*_*/ipblocks (ipb_timestamp);
+
+CREATE INDEX ipb_expiry ON /*_*/ipblocks (ipb_expiry);
+
+CREATE INDEX ipb_parent_block_id ON /*_*/ipblocks (ipb_parent_block_id);
diff --git a/sql/sqlite/patch-ipblocks_restrictions-ir_ipb_id.sql b/sql/sqlite/patch-ipblocks_restrictions-ir_ipb_id.sql
index 49e6a7b05909..b1defaee4cd3 100644
--- a/sql/sqlite/patch-ipblocks_restrictions-ir_ipb_id.sql
+++ b/sql/sqlite/patch-ipblocks_restrictions-ir_ipb_id.sql
@@ -1,15 +1,29 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-ipblocks_restrictions-ir_ipb_id.json
+-- Source: sql/abstractSchemaChanges/patch-ipblocks_restrictions-ir_ipb_id.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX ir_type_value;
CREATE TEMPORARY TABLE /*_*/__temp__ipblocks_restrictions AS
-SELECT ir_ipb_id, ir_type, ir_value
-FROM /*_*/ipblocks_restrictions;
-DROP TABLE /*_*/ipblocks_restrictions;
-CREATE TABLE /*_*/ipblocks_restrictions ( ir_ipb_id INTEGER UNSIGNED NOT NULL, ir_type SMALLINT NOT NULL, ir_value INTEGER UNSIGNED NOT NULL, PRIMARY KEY(ir_ipb_id, ir_type, ir_value) );
-INSERT INTO /*_*/ipblocks_restrictions (ir_ipb_id, ir_type, ir_value)
-SELECT ir_ipb_id, ir_type, ir_value
-FROM /*_*/__temp__ipblocks_restrictions;
-DROP TABLE /*_*/__temp__ipblocks_restrictions;
-CREATE INDEX ir_type_value ON /*_*/ipblocks_restrictions (ir_type, ir_value); \ No newline at end of file
+SELECT
+ ir_ipb_id,
+ ir_type,
+ ir_value
+FROM /*_*/ipblocks_restrictions;
+DROP TABLE /*_*/ipblocks_restrictions;
+
+
+CREATE TABLE /*_*/ipblocks_restrictions (
+ ir_ipb_id INTEGER UNSIGNED NOT NULL,
+ ir_type SMALLINT NOT NULL,
+ ir_value INTEGER UNSIGNED NOT NULL,
+ PRIMARY KEY(ir_ipb_id, ir_type, ir_value)
+ );
+INSERT INTO /*_*/ipblocks_restrictions (ir_ipb_id, ir_type, ir_value)
+SELECT
+ ir_ipb_id,
+ ir_type,
+ ir_value
+FROM
+ /*_*/__temp__ipblocks_restrictions;
+DROP TABLE /*_*/__temp__ipblocks_restrictions;
+
+CREATE INDEX ir_type_value ON /*_*/ipblocks_restrictions (ir_type, ir_value);
diff --git a/sql/sqlite/patch-ipblocks_restrictions-ir_value.sql b/sql/sqlite/patch-ipblocks_restrictions-ir_value.sql
index 4fdac77adf56..93e2245a47b6 100644
--- a/sql/sqlite/patch-ipblocks_restrictions-ir_value.sql
+++ b/sql/sqlite/patch-ipblocks_restrictions-ir_value.sql
@@ -1,15 +1,29 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-ipblocks_restrictions-ir_value.json
+-- Source: sql/abstractSchemaChanges/patch-ipblocks_restrictions-ir_value.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX ir_type_value;
CREATE TEMPORARY TABLE /*_*/__temp__ipblocks_restrictions AS
-SELECT ir_ipb_id, ir_type, ir_value
-FROM /*_*/ipblocks_restrictions;
-DROP TABLE /*_*/ipblocks_restrictions;
-CREATE TABLE /*_*/ipblocks_restrictions ( ir_ipb_id INTEGER NOT NULL, ir_type SMALLINT NOT NULL, ir_value INTEGER UNSIGNED NOT NULL, PRIMARY KEY(ir_ipb_id, ir_type, ir_value) );
-INSERT INTO /*_*/ipblocks_restrictions (ir_ipb_id, ir_type, ir_value)
-SELECT ir_ipb_id, ir_type, ir_value
-FROM /*_*/__temp__ipblocks_restrictions;
-DROP TABLE /*_*/__temp__ipblocks_restrictions;
-CREATE INDEX ir_type_value ON /*_*/ipblocks_restrictions (ir_type, ir_value); \ No newline at end of file
+SELECT
+ ir_ipb_id,
+ ir_type,
+ ir_value
+FROM /*_*/ipblocks_restrictions;
+DROP TABLE /*_*/ipblocks_restrictions;
+
+
+CREATE TABLE /*_*/ipblocks_restrictions (
+ ir_ipb_id INTEGER NOT NULL,
+ ir_type SMALLINT NOT NULL,
+ ir_value INTEGER UNSIGNED NOT NULL,
+ PRIMARY KEY(ir_ipb_id, ir_type, ir_value)
+ );
+INSERT INTO /*_*/ipblocks_restrictions (ir_ipb_id, ir_type, ir_value)
+SELECT
+ ir_ipb_id,
+ ir_type,
+ ir_value
+FROM
+ /*_*/__temp__ipblocks_restrictions;
+DROP TABLE /*_*/__temp__ipblocks_restrictions;
+
+CREATE INDEX ir_type_value ON /*_*/ipblocks_restrictions (ir_type, ir_value);
diff --git a/sql/sqlite/patch-iwlinks-drop-iwl_prefix_from_title.sql b/sql/sqlite/patch-iwlinks-drop-iwl_prefix_from_title.sql
index f37b4ab29f3e..104220f67363 100644
--- a/sql/sqlite/patch-iwlinks-drop-iwl_prefix_from_title.sql
+++ b/sql/sqlite/patch-iwlinks-drop-iwl_prefix_from_title.sql
@@ -1,5 +1,5 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-iwlinks-drop-iwl_prefix_from_title.json
+-- Source: sql/abstractSchemaChanges/patch-iwlinks-drop-iwl_prefix_from_title.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__iwlinks AS
diff --git a/sql/sqlite/patch-logging-rename-indexes.sql b/sql/sqlite/patch-logging-rename-indexes.sql
index f2da25425437..cf627d1816a7 100644
--- a/sql/sqlite/patch-logging-rename-indexes.sql
+++ b/sql/sqlite/patch-logging-rename-indexes.sql
@@ -1,27 +1,73 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-logging-rename-indexes.json
+-- Source: sql/abstractSchemaChanges/patch-logging-rename-indexes.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX type_time;
-DROP INDEX actor_time;
-DROP INDEX page_time;
-DROP INDEX times;
-DROP INDEX log_actor_type_time;
-DROP INDEX log_page_id_time;
-DROP INDEX log_type_action;
CREATE TEMPORARY TABLE /*_*/__temp__logging AS
-SELECT log_id, log_type, log_action, log_timestamp, log_actor, log_namespace, log_title, log_page, log_comment_id, log_params, log_deleted
-FROM /*_*/logging;
-DROP TABLE /*_*/logging;
-CREATE TABLE /*_*/logging ( log_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, log_type BLOB DEFAULT '' NOT NULL, log_action BLOB DEFAULT '' NOT NULL, log_timestamp BLOB DEFAULT '19700101000000' NOT NULL, log_actor BIGINT UNSIGNED NOT NULL, log_namespace INTEGER DEFAULT 0 NOT NULL, log_title BLOB DEFAULT '' NOT NULL, log_page INTEGER UNSIGNED DEFAULT NULL, log_comment_id BIGINT UNSIGNED NOT NULL, log_params BLOB NOT NULL, log_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL );
-INSERT INTO /*_*/logging ( log_id, log_type, log_action, log_timestamp, log_actor, log_namespace, log_title, log_page, log_comment_id, log_params, log_deleted )
-SELECT log_id, log_type, log_action, log_timestamp, log_actor, log_namespace, log_title, log_page, log_comment_id, log_params, log_deleted
-FROM /*_*/__temp__logging;
-DROP TABLE /*_*/__temp__logging;
-CREATE INDEX log_actor_type_time ON /*_*/logging ( log_actor, log_type, log_timestamp );
-CREATE INDEX log_page_id_time ON /*_*/logging (log_page, log_timestamp);
-CREATE INDEX log_type_action ON /*_*/logging ( log_type, log_action, log_timestamp );
-CREATE INDEX log_type_time ON /*_*/logging (log_type, log_timestamp);
-CREATE INDEX log_actor_time ON /*_*/logging (log_actor, log_timestamp);
-CREATE INDEX log_page_time ON /*_*/logging ( log_namespace, log_title, log_timestamp );
-CREATE INDEX log_times ON /*_*/logging (log_timestamp); \ No newline at end of file
+SELECT
+ log_id,
+ log_type,
+ log_action,
+ log_timestamp,
+ log_actor,
+ log_namespace,
+ log_title,
+ log_page,
+ log_comment_id,
+ log_params,
+ log_deleted
+FROM /*_*/logging;
+DROP TABLE /*_*/logging;
+
+
+CREATE TABLE /*_*/logging (
+ log_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ log_type BLOB DEFAULT '' NOT NULL, log_action BLOB DEFAULT '' NOT NULL,
+ log_timestamp BLOB DEFAULT '19700101000000' NOT NULL,
+ log_actor BIGINT UNSIGNED NOT NULL,
+ log_namespace INTEGER DEFAULT 0 NOT NULL,
+ log_title BLOB DEFAULT '' NOT NULL,
+ log_page INTEGER UNSIGNED DEFAULT NULL,
+ log_comment_id BIGINT UNSIGNED NOT NULL,
+ log_params BLOB NOT NULL, log_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL
+ );
+INSERT INTO /*_*/logging (
+ log_id, log_type, log_action, log_timestamp,
+ log_actor, log_namespace, log_title,
+ log_page, log_comment_id, log_params,
+ log_deleted
+ )
+SELECT
+ log_id,
+ log_type,
+ log_action,
+ log_timestamp,
+ log_actor,
+ log_namespace,
+ log_title,
+ log_page,
+ log_comment_id,
+ log_params,
+ log_deleted
+FROM
+ /*_*/__temp__logging;
+DROP TABLE /*_*/__temp__logging;
+
+CREATE INDEX log_actor_type_time ON /*_*/logging (
+ log_actor, log_type, log_timestamp
+ );
+
+CREATE INDEX log_page_id_time ON /*_*/logging (log_page, log_timestamp);
+
+CREATE INDEX log_type_action ON /*_*/logging (
+ log_type, log_action, log_timestamp
+ );
+
+CREATE INDEX log_type_time ON /*_*/logging (log_type, log_timestamp);
+
+CREATE INDEX log_actor_time ON /*_*/logging (log_actor, log_timestamp);
+
+CREATE INDEX log_page_time ON /*_*/logging (
+ log_namespace, log_title, log_timestamp
+ );
+
+CREATE INDEX log_times ON /*_*/logging (log_timestamp);
diff --git a/sql/sqlite/patch-objectcache-modtoken.sql b/sql/sqlite/patch-objectcache-modtoken.sql
index df327813d3d3..4f2b6c6a2b90 100644
--- a/sql/sqlite/patch-objectcache-modtoken.sql
+++ b/sql/sqlite/patch-objectcache-modtoken.sql
@@ -1,8 +1,8 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-objectcache-modtoken.json
+-- Source: sql/abstractSchemaChanges/patch-objectcache-modtoken.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-ALTER TABLE /*_*/objectcache
-ADD COLUMN modtoken VARCHAR(17) DEFAULT '00000000000000000' NOT NULL;
-ALTER TABLE /*_*/objectcache
-ADD COLUMN flags INTEGER UNSIGNED DEFAULT NULL; \ No newline at end of file
+ALTER TABLE /*_*/objectcache
+ ADD COLUMN modtoken VARCHAR(17) DEFAULT '00000000000000000' NOT NULL;
+ALTER TABLE /*_*/objectcache
+ ADD COLUMN flags INTEGER UNSIGNED DEFAULT NULL;
diff --git a/sql/sqlite/patch-oldimage-oi_size_to_bigint.sql b/sql/sqlite/patch-oldimage-oi_size_to_bigint.sql
index b6c813821196..bd0e987b7838 100644
--- a/sql/sqlite/patch-oldimage-oi_size_to_bigint.sql
+++ b/sql/sqlite/patch-oldimage-oi_size_to_bigint.sql
@@ -1,18 +1,75 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: abstractSchemaChanges/patch-oldimage-oi_size_to_bigint.json
+-- Source: sql/abstractSchemaChanges/patch-oldimage-oi_size_to_bigint.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__oldimage AS
-SELECT oi_name, oi_archive_name, oi_size, oi_width, oi_height, oi_bits, oi_description_id, oi_actor, oi_timestamp, oi_metadata, oi_media_type, oi_major_mime, oi_minor_mime, oi_deleted, oi_sha1
-FROM /*_*/oldimage;
-DROP TABLE /*_*/oldimage;
-CREATE TABLE /*_*/oldimage ( oi_name BLOB DEFAULT '' NOT NULL, oi_archive_name BLOB DEFAULT '' NOT NULL, oi_size BIGINT UNSIGNED DEFAULT 0 NOT NULL, oi_width INTEGER DEFAULT 0 NOT NULL, oi_height INTEGER DEFAULT 0 NOT NULL, oi_bits INTEGER DEFAULT 0 NOT NULL, oi_description_id BIGINT UNSIGNED NOT NULL, oi_actor BIGINT UNSIGNED NOT NULL, oi_timestamp BLOB NOT NULL, oi_metadata BLOB NOT NULL, oi_media_type TEXT DEFAULT NULL, oi_major_mime TEXT DEFAULT 'unknown' NOT NULL, oi_minor_mime BLOB DEFAULT 'unknown' NOT NULL, oi_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL, oi_sha1 BLOB DEFAULT '' NOT NULL );
-INSERT INTO /*_*/oldimage ( oi_name, oi_archive_name, oi_size, oi_width, oi_height, oi_bits, oi_description_id, oi_actor, oi_timestamp, oi_metadata, oi_media_type, oi_major_mime, oi_minor_mime, oi_deleted, oi_sha1 )
-SELECT oi_name, oi_archive_name, oi_size, oi_width, oi_height, oi_bits, oi_description_id, oi_actor, oi_timestamp, oi_metadata, oi_media_type, oi_major_mime, oi_minor_mime, oi_deleted, oi_sha1
-FROM /*_*/__temp__oldimage;
-DROP TABLE /*_*/__temp__oldimage;
-CREATE INDEX oi_actor_timestamp ON /*_*/oldimage (oi_actor, oi_timestamp);
-CREATE INDEX oi_name_timestamp ON /*_*/oldimage (oi_name, oi_timestamp);
-CREATE INDEX oi_name_archive_name ON /*_*/oldimage (oi_name, oi_archive_name);
-CREATE INDEX oi_sha1 ON /*_*/oldimage (oi_sha1);
-CREATE INDEX oi_timestamp ON /*_*/oldimage (oi_timestamp); \ No newline at end of file
+SELECT
+ oi_name,
+ oi_archive_name,
+ oi_size,
+ oi_width,
+ oi_height,
+ oi_bits,
+ oi_description_id,
+ oi_actor,
+ oi_timestamp,
+ oi_metadata,
+ oi_media_type,
+ oi_major_mime,
+ oi_minor_mime,
+ oi_deleted,
+ oi_sha1
+FROM /*_*/oldimage;
+DROP TABLE /*_*/oldimage;
+
+
+CREATE TABLE /*_*/oldimage (
+ oi_name BLOB DEFAULT '' NOT NULL, oi_archive_name BLOB DEFAULT '' NOT NULL,
+ oi_size BIGINT UNSIGNED DEFAULT 0 NOT NULL,
+ oi_width INTEGER DEFAULT 0 NOT NULL,
+ oi_height INTEGER DEFAULT 0 NOT NULL,
+ oi_bits INTEGER DEFAULT 0 NOT NULL,
+ oi_description_id BIGINT UNSIGNED NOT NULL,
+ oi_actor BIGINT UNSIGNED NOT NULL,
+ oi_timestamp BLOB NOT NULL, oi_metadata BLOB NOT NULL,
+ oi_media_type TEXT DEFAULT NULL, oi_major_mime TEXT DEFAULT 'unknown' NOT NULL,
+ oi_minor_mime BLOB DEFAULT 'unknown' NOT NULL,
+ oi_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ oi_sha1 BLOB DEFAULT '' NOT NULL
+ );
+INSERT INTO /*_*/oldimage (
+ oi_name, oi_archive_name, oi_size,
+ oi_width, oi_height, oi_bits, oi_description_id,
+ oi_actor, oi_timestamp, oi_metadata,
+ oi_media_type, oi_major_mime, oi_minor_mime,
+ oi_deleted, oi_sha1
+ )
+SELECT
+ oi_name,
+ oi_archive_name,
+ oi_size,
+ oi_width,
+ oi_height,
+ oi_bits,
+ oi_description_id,
+ oi_actor,
+ oi_timestamp,
+ oi_metadata,
+ oi_media_type,
+ oi_major_mime,
+ oi_minor_mime,
+ oi_deleted,
+ oi_sha1
+FROM
+ /*_*/__temp__oldimage;
+DROP TABLE /*_*/__temp__oldimage;
+
+CREATE INDEX oi_actor_timestamp ON /*_*/oldimage (oi_actor, oi_timestamp);
+
+CREATE INDEX oi_name_timestamp ON /*_*/oldimage (oi_name, oi_timestamp);
+
+CREATE INDEX oi_name_archive_name ON /*_*/oldimage (oi_name, oi_archive_name);
+
+CREATE INDEX oi_sha1 ON /*_*/oldimage (oi_sha1);
+
+CREATE INDEX oi_timestamp ON /*_*/oldimage (oi_timestamp);
diff --git a/sql/sqlite/patch-oldimage-oi_timestamp.sql b/sql/sqlite/patch-oldimage-oi_timestamp.sql
index 411a6f8ed277..c9c648c6d208 100644
--- a/sql/sqlite/patch-oldimage-oi_timestamp.sql
+++ b/sql/sqlite/patch-oldimage-oi_timestamp.sql
@@ -1,22 +1,75 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-oldimage-oi_timestamp.json
+-- Source: sql/abstractSchemaChanges/patch-oldimage-oi_timestamp.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX oi_actor_timestamp;
-DROP INDEX oi_name_timestamp;
-DROP INDEX oi_name_archive_name;
-DROP INDEX oi_sha1;
CREATE TEMPORARY TABLE /*_*/__temp__oldimage AS
-SELECT oi_name, oi_archive_name, oi_size, oi_width, oi_height, oi_bits, oi_description_id, oi_actor, oi_timestamp, oi_metadata, oi_media_type, oi_major_mime, oi_minor_mime, oi_deleted, oi_sha1
-FROM /*_*/oldimage;
-DROP TABLE /*_*/oldimage;
-CREATE TABLE /*_*/oldimage ( oi_name BLOB DEFAULT '' NOT NULL, oi_archive_name BLOB DEFAULT '' NOT NULL, oi_size INTEGER UNSIGNED DEFAULT 0 NOT NULL, oi_width INTEGER DEFAULT 0 NOT NULL, oi_height INTEGER DEFAULT 0 NOT NULL, oi_bits INTEGER DEFAULT 0 NOT NULL, oi_description_id BIGINT UNSIGNED NOT NULL, oi_actor BIGINT UNSIGNED NOT NULL, oi_timestamp BLOB NOT NULL, oi_metadata BLOB NOT NULL, oi_media_type TEXT DEFAULT NULL, oi_major_mime TEXT DEFAULT 'unknown' NOT NULL, oi_minor_mime BLOB DEFAULT 'unknown' NOT NULL, oi_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL, oi_sha1 BLOB DEFAULT '' NOT NULL );
-INSERT INTO /*_*/oldimage ( oi_name, oi_archive_name, oi_size, oi_width, oi_height, oi_bits, oi_description_id, oi_actor, oi_timestamp, oi_metadata, oi_media_type, oi_major_mime, oi_minor_mime, oi_deleted, oi_sha1 )
-SELECT oi_name, oi_archive_name, oi_size, oi_width, oi_height, oi_bits, oi_description_id, oi_actor, oi_timestamp, oi_metadata, oi_media_type, oi_major_mime, oi_minor_mime, oi_deleted, oi_sha1
-FROM /*_*/__temp__oldimage;
-DROP TABLE /*_*/__temp__oldimage;
-CREATE INDEX oi_actor_timestamp ON /*_*/oldimage (oi_actor, oi_timestamp);
-CREATE INDEX oi_name_timestamp ON /*_*/oldimage (oi_name, oi_timestamp);
-CREATE INDEX oi_name_archive_name ON /*_*/oldimage (oi_name, oi_archive_name);
-CREATE INDEX oi_sha1 ON /*_*/oldimage (oi_sha1);
-CREATE INDEX oi_timestamp ON /*_*/oldimage (oi_timestamp); \ No newline at end of file
+SELECT
+ oi_name,
+ oi_archive_name,
+ oi_size,
+ oi_width,
+ oi_height,
+ oi_bits,
+ oi_description_id,
+ oi_actor,
+ oi_timestamp,
+ oi_metadata,
+ oi_media_type,
+ oi_major_mime,
+ oi_minor_mime,
+ oi_deleted,
+ oi_sha1
+FROM /*_*/oldimage;
+DROP TABLE /*_*/oldimage;
+
+
+CREATE TABLE /*_*/oldimage (
+ oi_name BLOB DEFAULT '' NOT NULL, oi_archive_name BLOB DEFAULT '' NOT NULL,
+ oi_size INTEGER UNSIGNED DEFAULT 0 NOT NULL,
+ oi_width INTEGER DEFAULT 0 NOT NULL,
+ oi_height INTEGER DEFAULT 0 NOT NULL,
+ oi_bits INTEGER DEFAULT 0 NOT NULL,
+ oi_description_id BIGINT UNSIGNED NOT NULL,
+ oi_actor BIGINT UNSIGNED NOT NULL,
+ oi_timestamp BLOB NOT NULL, oi_metadata BLOB NOT NULL,
+ oi_media_type TEXT DEFAULT NULL, oi_major_mime TEXT DEFAULT 'unknown' NOT NULL,
+ oi_minor_mime BLOB DEFAULT 'unknown' NOT NULL,
+ oi_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ oi_sha1 BLOB DEFAULT '' NOT NULL
+ );
+INSERT INTO /*_*/oldimage (
+ oi_name, oi_archive_name, oi_size,
+ oi_width, oi_height, oi_bits, oi_description_id,
+ oi_actor, oi_timestamp, oi_metadata,
+ oi_media_type, oi_major_mime, oi_minor_mime,
+ oi_deleted, oi_sha1
+ )
+SELECT
+ oi_name,
+ oi_archive_name,
+ oi_size,
+ oi_width,
+ oi_height,
+ oi_bits,
+ oi_description_id,
+ oi_actor,
+ oi_timestamp,
+ oi_metadata,
+ oi_media_type,
+ oi_major_mime,
+ oi_minor_mime,
+ oi_deleted,
+ oi_sha1
+FROM
+ /*_*/__temp__oldimage;
+DROP TABLE /*_*/__temp__oldimage;
+
+CREATE INDEX oi_actor_timestamp ON /*_*/oldimage (oi_actor, oi_timestamp);
+
+CREATE INDEX oi_name_timestamp ON /*_*/oldimage (oi_name, oi_timestamp);
+
+CREATE INDEX oi_name_archive_name ON /*_*/oldimage (oi_name, oi_archive_name);
+
+CREATE INDEX oi_sha1 ON /*_*/oldimage (oi_sha1);
+
+CREATE INDEX oi_timestamp ON /*_*/oldimage (oi_timestamp);
diff --git a/sql/sqlite/patch-page-drop-page_restrictions.sql b/sql/sqlite/patch-page-drop-page_restrictions.sql
index 6b033808ef05..e21c06a34fe0 100644
--- a/sql/sqlite/patch-page-drop-page_restrictions.sql
+++ b/sql/sqlite/patch-page-drop-page_restrictions.sql
@@ -1,21 +1,68 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-page-drop-page_restrictions.json
+-- Source: sql/abstractSchemaChanges/patch-page-drop-page_restrictions.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX page_name_title;
-DROP INDEX page_random;
-DROP INDEX page_len;
-DROP INDEX page_redirect_namespace_len;
CREATE TEMPORARY TABLE /*_*/__temp__page AS
-SELECT page_id, page_namespace, page_title, page_is_redirect, page_is_new, page_random, page_touched, page_links_updated, page_latest, page_len, page_content_model, page_lang
-FROM /*_*/page;
-DROP TABLE /*_*/page;
-CREATE TABLE /*_*/page ( page_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, page_namespace INTEGER NOT NULL, page_title BLOB NOT NULL, page_is_redirect SMALLINT UNSIGNED DEFAULT 0 NOT NULL, page_is_new SMALLINT UNSIGNED DEFAULT 0 NOT NULL, page_random DOUBLE PRECISION NOT NULL, page_touched BLOB NOT NULL, page_links_updated BLOB DEFAULT NULL, page_latest INTEGER UNSIGNED NOT NULL, page_len INTEGER UNSIGNED NOT NULL, page_content_model BLOB DEFAULT NULL, page_lang BLOB DEFAULT NULL );
-INSERT INTO /*_*/page ( page_id, page_namespace, page_title, page_is_redirect, page_is_new, page_random, page_touched, page_links_updated, page_latest, page_len, page_content_model, page_lang )
-SELECT page_id, page_namespace, page_title, page_is_redirect, page_is_new, page_random, page_touched, page_links_updated, page_latest, page_len, page_content_model, page_lang
-FROM /*_*/__temp__page;
-DROP TABLE /*_*/__temp__page;
-CREATE UNIQUE INDEX page_name_title ON /*_*/page (page_namespace, page_title);
-CREATE INDEX page_random ON /*_*/page (page_random);
-CREATE INDEX page_len ON /*_*/page (page_len);
-CREATE INDEX page_redirect_namespace_len ON /*_*/page ( page_is_redirect, page_namespace, page_len ); \ No newline at end of file
+SELECT
+ page_id,
+ page_namespace,
+ page_title,
+ page_is_redirect,
+ page_is_new,
+ page_random,
+ page_touched,
+ page_links_updated,
+ page_latest,
+ page_len,
+ page_content_model,
+ page_lang
+FROM /*_*/page;
+DROP TABLE /*_*/page;
+
+
+CREATE TABLE /*_*/page (
+ page_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ page_namespace INTEGER NOT NULL, page_title BLOB NOT NULL,
+ page_is_redirect SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ page_is_new SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ page_random DOUBLE PRECISION NOT NULL,
+ page_touched BLOB NOT NULL, page_links_updated BLOB DEFAULT NULL,
+ page_latest INTEGER UNSIGNED NOT NULL,
+ page_len INTEGER UNSIGNED NOT NULL,
+ page_content_model BLOB DEFAULT NULL,
+ page_lang BLOB DEFAULT NULL
+ );
+INSERT INTO /*_*/page (
+ page_id, page_namespace, page_title,
+ page_is_redirect, page_is_new, page_random,
+ page_touched, page_links_updated,
+ page_latest, page_len, page_content_model,
+ page_lang
+ )
+SELECT
+ page_id,
+ page_namespace,
+ page_title,
+ page_is_redirect,
+ page_is_new,
+ page_random,
+ page_touched,
+ page_links_updated,
+ page_latest,
+ page_len,
+ page_content_model,
+ page_lang
+FROM
+ /*_*/__temp__page;
+DROP TABLE /*_*/__temp__page;
+
+CREATE UNIQUE INDEX page_name_title ON /*_*/page (page_namespace, page_title);
+
+CREATE INDEX page_random ON /*_*/page (page_random);
+
+CREATE INDEX page_len ON /*_*/page (page_len);
+
+CREATE INDEX page_redirect_namespace_len ON /*_*/page (
+ page_is_redirect, page_namespace,
+ page_len
+ );
diff --git a/sql/sqlite/patch-page-rename-name_title-index.sql b/sql/sqlite/patch-page-rename-name_title-index.sql
index d1f2f1ff1bae..5bcd56225c2e 100644
--- a/sql/sqlite/patch-page-rename-name_title-index.sql
+++ b/sql/sqlite/patch-page-rename-name_title-index.sql
@@ -1,21 +1,68 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-page-rename-name_title-index.json
+-- Source: sql/abstractSchemaChanges/patch-page-rename-name_title-index.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX name_title;
-DROP INDEX page_random;
-DROP INDEX page_len;
-DROP INDEX page_redirect_namespace_len;
CREATE TEMPORARY TABLE /*_*/__temp__page AS
-SELECT page_id, page_namespace, page_title, page_is_redirect, page_is_new, page_random, page_touched, page_links_updated, page_latest, page_len, page_content_model, page_lang
-FROM /*_*/page;
-DROP TABLE /*_*/page;
-CREATE TABLE /*_*/page ( page_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, page_namespace INTEGER NOT NULL, page_title BLOB NOT NULL, page_is_redirect SMALLINT DEFAULT 0 NOT NULL, page_is_new SMALLINT DEFAULT 0 NOT NULL, page_random DOUBLE PRECISION NOT NULL, page_touched BLOB NOT NULL, page_links_updated BLOB DEFAULT NULL, page_latest INTEGER UNSIGNED NOT NULL, page_len INTEGER UNSIGNED NOT NULL, page_content_model BLOB DEFAULT NULL, page_lang BLOB DEFAULT NULL );
-INSERT INTO /*_*/page ( page_id, page_namespace, page_title, page_is_redirect, page_is_new, page_random, page_touched, page_links_updated, page_latest, page_len, page_content_model, page_lang )
-SELECT page_id, page_namespace, page_title, page_is_redirect, page_is_new, page_random, page_touched, page_links_updated, page_latest, page_len, page_content_model, page_lang
-FROM /*_*/__temp__page;
-DROP TABLE /*_*/__temp__page;
-CREATE INDEX page_random ON /*_*/page (page_random);
-CREATE INDEX page_len ON /*_*/page (page_len);
-CREATE INDEX page_redirect_namespace_len ON /*_*/page ( page_is_redirect, page_namespace, page_len );
-CREATE UNIQUE INDEX page_name_title ON /*_*/page (page_namespace, page_title);
+SELECT
+ page_id,
+ page_namespace,
+ page_title,
+ page_is_redirect,
+ page_is_new,
+ page_random,
+ page_touched,
+ page_links_updated,
+ page_latest,
+ page_len,
+ page_content_model,
+ page_lang
+FROM /*_*/page;
+DROP TABLE /*_*/page;
+
+
+CREATE TABLE /*_*/page (
+ page_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ page_namespace INTEGER NOT NULL, page_title BLOB NOT NULL,
+ page_is_redirect SMALLINT DEFAULT 0 NOT NULL,
+ page_is_new SMALLINT DEFAULT 0 NOT NULL,
+ page_random DOUBLE PRECISION NOT NULL,
+ page_touched BLOB NOT NULL, page_links_updated BLOB DEFAULT NULL,
+ page_latest INTEGER UNSIGNED NOT NULL,
+ page_len INTEGER UNSIGNED NOT NULL,
+ page_content_model BLOB DEFAULT NULL,
+ page_lang BLOB DEFAULT NULL
+ );
+INSERT INTO /*_*/page (
+ page_id, page_namespace, page_title,
+ page_is_redirect, page_is_new, page_random,
+ page_touched, page_links_updated,
+ page_latest, page_len, page_content_model,
+ page_lang
+ )
+SELECT
+ page_id,
+ page_namespace,
+ page_title,
+ page_is_redirect,
+ page_is_new,
+ page_random,
+ page_touched,
+ page_links_updated,
+ page_latest,
+ page_len,
+ page_content_model,
+ page_lang
+FROM
+ /*_*/__temp__page;
+DROP TABLE /*_*/__temp__page;
+
+CREATE INDEX page_random ON /*_*/page (page_random);
+
+CREATE INDEX page_len ON /*_*/page (page_len);
+
+CREATE INDEX page_redirect_namespace_len ON /*_*/page (
+ page_is_redirect, page_namespace,
+ page_len
+ );
+
+CREATE UNIQUE INDEX page_name_title ON /*_*/page (page_namespace, page_title);
diff --git a/sql/sqlite/patch-page_props-pp_page.sql b/sql/sqlite/patch-page_props-pp_page.sql
index b69252ac4a66..382185a1db0d 100644
--- a/sql/sqlite/patch-page_props-pp_page.sql
+++ b/sql/sqlite/patch-page_props-pp_page.sql
@@ -1,17 +1,36 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-page_props-pp_page.json
+-- Source: sql/abstractSchemaChanges/patch-page_props-pp_page.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX pp_propname_page;
-DROP INDEX pp_propname_sortkey_page;
CREATE TEMPORARY TABLE /*_*/__temp__page_props AS
-SELECT pp_page, pp_propname, pp_value, pp_sortkey
-FROM /*_*/page_props;
-DROP TABLE /*_*/page_props;
-CREATE TABLE /*_*/page_props ( pp_page INTEGER UNSIGNED NOT NULL, pp_propname BLOB NOT NULL, pp_value BLOB NOT NULL, pp_sortkey DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(pp_page, pp_propname) );
-INSERT INTO /*_*/page_props ( pp_page, pp_propname, pp_value, pp_sortkey )
-SELECT pp_page, pp_propname, pp_value, pp_sortkey
-FROM /*_*/__temp__page_props;
-DROP TABLE /*_*/__temp__page_props;
-CREATE UNIQUE INDEX pp_propname_page ON /*_*/page_props (pp_propname, pp_page);
-CREATE UNIQUE INDEX pp_propname_sortkey_page ON /*_*/page_props (pp_propname, pp_sortkey, pp_page); \ No newline at end of file
+SELECT
+ pp_page,
+ pp_propname,
+ pp_value,
+ pp_sortkey
+FROM /*_*/page_props;
+DROP TABLE /*_*/page_props;
+
+
+CREATE TABLE /*_*/page_props (
+ pp_page INTEGER UNSIGNED NOT NULL,
+ pp_propname BLOB NOT NULL,
+ pp_value BLOB NOT NULL,
+ pp_sortkey DOUBLE PRECISION DEFAULT NULL,
+ PRIMARY KEY(pp_page, pp_propname)
+ );
+INSERT INTO /*_*/page_props (
+ pp_page, pp_propname, pp_value, pp_sortkey
+ )
+SELECT
+ pp_page,
+ pp_propname,
+ pp_value,
+ pp_sortkey
+FROM
+ /*_*/__temp__page_props;
+DROP TABLE /*_*/__temp__page_props;
+
+CREATE UNIQUE INDEX pp_propname_page ON /*_*/page_props (pp_propname, pp_page);
+
+CREATE UNIQUE INDEX pp_propname_sortkey_page ON /*_*/page_props (pp_propname, pp_sortkey, pp_page);
diff --git a/sql/sqlite/patch-page_restrictions-pr_page.sql b/sql/sqlite/patch-page_restrictions-pr_page.sql
index e215c1c3b78e..6dcb35c3a001 100644
--- a/sql/sqlite/patch-page_restrictions-pr_page.sql
+++ b/sql/sqlite/patch-page_restrictions-pr_page.sql
@@ -1,21 +1,44 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-page_restrictions-pr_page.json
+-- Source: sql/abstractSchemaChanges/patch-page_restrictions-pr_page.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX pr_pagetype;
-DROP INDEX pr_typelevel;
-DROP INDEX pr_level;
-DROP INDEX pr_cascade;
CREATE TEMPORARY TABLE /*_*/__temp__page_restrictions AS
-SELECT pr_id, pr_page, pr_type, pr_level, pr_cascade, pr_expiry
-FROM /*_*/page_restrictions;
-DROP TABLE /*_*/page_restrictions;
-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 );
-INSERT INTO /*_*/page_restrictions ( pr_id, pr_page, pr_type, pr_level, pr_cascade, pr_expiry )
-SELECT pr_id, pr_page, pr_type, pr_level, pr_cascade, pr_expiry
-FROM /*_*/__temp__page_restrictions;
-DROP TABLE /*_*/__temp__page_restrictions;
-CREATE UNIQUE INDEX pr_pagetype ON /*_*/page_restrictions (pr_page, pr_type);
-CREATE INDEX pr_typelevel ON /*_*/page_restrictions (pr_type, pr_level);
-CREATE INDEX pr_level ON /*_*/page_restrictions (pr_level);
-CREATE INDEX pr_cascade ON /*_*/page_restrictions (pr_cascade); \ No newline at end of file
+SELECT
+ pr_id,
+ pr_page,
+ pr_type,
+ pr_level,
+ pr_cascade,
+ pr_expiry
+FROM /*_*/page_restrictions;
+DROP TABLE /*_*/page_restrictions;
+
+
+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
+ );
+INSERT INTO /*_*/page_restrictions (
+ pr_id, pr_page, pr_type, pr_level,
+ pr_cascade, pr_expiry
+ )
+SELECT
+ pr_id,
+ pr_page,
+ pr_type,
+ pr_level,
+ pr_cascade,
+ pr_expiry
+FROM
+ /*_*/__temp__page_restrictions;
+DROP TABLE /*_*/__temp__page_restrictions;
+
+CREATE UNIQUE INDEX pr_pagetype ON /*_*/page_restrictions (pr_page, pr_type);
+
+CREATE INDEX pr_typelevel ON /*_*/page_restrictions (pr_type, pr_level);
+
+CREATE INDEX pr_level ON /*_*/page_restrictions (pr_level);
+
+CREATE INDEX pr_cascade ON /*_*/page_restrictions (pr_cascade);
diff --git a/sql/sqlite/patch-pagelinks-drop-pl_title.sql b/sql/sqlite/patch-pagelinks-drop-pl_title.sql
index 9f2840e8c3ec..45416c3bea9a 100644
--- a/sql/sqlite/patch-pagelinks-drop-pl_title.sql
+++ b/sql/sqlite/patch-pagelinks-drop-pl_title.sql
@@ -1,5 +1,5 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-pagelinks-drop-pl_title.json
+-- Source: sql/abstractSchemaChanges/patch-pagelinks-drop-pl_title.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__pagelinks AS
diff --git a/sql/sqlite/patch-pagelinks-target_id.sql b/sql/sqlite/patch-pagelinks-target_id.sql
index d8e80ca85913..f2821143dbd6 100644
--- a/sql/sqlite/patch-pagelinks-target_id.sql
+++ b/sql/sqlite/patch-pagelinks-target_id.sql
@@ -1,17 +1,47 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-pagelinks-target_id.json
+-- Source: sql/abstractSchemaChanges/patch-pagelinks-target_id.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__pagelinks AS
-SELECT pl_from, pl_namespace, pl_title, pl_from_namespace
-FROM /*_*/pagelinks;
-DROP TABLE /*_*/pagelinks;
-CREATE TABLE /*_*/pagelinks ( pl_from INTEGER UNSIGNED DEFAULT 0 NOT NULL, pl_namespace INTEGER DEFAULT 0 NOT NULL, pl_title BLOB DEFAULT '' NOT NULL, pl_from_namespace INTEGER DEFAULT 0 NOT NULL, pl_target_id BIGINT UNSIGNED DEFAULT NULL, PRIMARY KEY(pl_from, pl_namespace, pl_title) );
-INSERT INTO /*_*/pagelinks ( pl_from, pl_namespace, pl_title, pl_from_namespace )
-SELECT pl_from, pl_namespace, pl_title, pl_from_namespace
-FROM /*_*/__temp__pagelinks;
-DROP TABLE /*_*/__temp__pagelinks;
-CREATE INDEX pl_namespace ON /*_*/pagelinks (pl_namespace, pl_title, pl_from);
-CREATE INDEX pl_backlinks_namespace ON /*_*/pagelinks ( pl_from_namespace, pl_namespace, pl_title, pl_from );
-CREATE INDEX pl_target_id ON /*_*/pagelinks (pl_target_id, pl_from);
-CREATE INDEX pl_backlinks_namespace_target_id ON /*_*/pagelinks ( pl_from_namespace, pl_target_id, pl_from ); \ No newline at end of file
+SELECT
+ pl_from,
+ pl_namespace,
+ pl_title,
+ pl_from_namespace
+FROM /*_*/pagelinks;
+DROP TABLE /*_*/pagelinks;
+
+
+CREATE TABLE /*_*/pagelinks (
+ pl_from INTEGER UNSIGNED DEFAULT 0 NOT NULL,
+ pl_namespace INTEGER DEFAULT 0 NOT NULL,
+ pl_title BLOB DEFAULT '' NOT NULL,
+ pl_from_namespace INTEGER DEFAULT 0 NOT NULL,
+ pl_target_id BIGINT UNSIGNED DEFAULT NULL,
+ PRIMARY KEY(pl_from, pl_namespace, pl_title)
+ );
+INSERT INTO /*_*/pagelinks (
+ pl_from, pl_namespace, pl_title, pl_from_namespace
+ )
+SELECT
+ pl_from,
+ pl_namespace,
+ pl_title,
+ pl_from_namespace
+FROM
+ /*_*/__temp__pagelinks;
+DROP TABLE /*_*/__temp__pagelinks;
+
+CREATE INDEX pl_namespace ON /*_*/pagelinks (pl_namespace, pl_title, pl_from);
+
+CREATE INDEX pl_backlinks_namespace ON /*_*/pagelinks (
+ pl_from_namespace, pl_namespace,
+ pl_title, pl_from
+ );
+
+CREATE INDEX pl_target_id ON /*_*/pagelinks (pl_target_id, pl_from);
+
+CREATE INDEX pl_backlinks_namespace_target_id ON /*_*/pagelinks (
+ pl_from_namespace, pl_target_id,
+ pl_from
+ );
diff --git a/sql/sqlite/patch-recentchanges-rc_new_name_timestamp.sql b/sql/sqlite/patch-recentchanges-rc_new_name_timestamp.sql
index 3acbb592ad36..b55ca6a99cea 100644
--- a/sql/sqlite/patch-recentchanges-rc_new_name_timestamp.sql
+++ b/sql/sqlite/patch-recentchanges-rc_new_name_timestamp.sql
@@ -1,31 +1,114 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-recentchanges-rc_new_name_timestamp.json
+-- Source: sql/abstractSchemaChanges/patch-recentchanges-rc_new_name_timestamp.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX rc_timestamp;
-DROP INDEX rc_namespace_title_timestamp;
-DROP INDEX rc_cur_id;
-DROP INDEX new_name_timestamp;
-DROP INDEX rc_ip;
-DROP INDEX rc_ns_actor;
-DROP INDEX rc_actor;
-DROP INDEX rc_name_type_patrolled_timestamp;
-DROP INDEX rc_this_oldid;
CREATE TEMPORARY TABLE /*_*/__temp__recentchanges AS
-SELECT rc_id, rc_timestamp, rc_actor, rc_namespace, rc_title, rc_comment_id, rc_minor, rc_bot, rc_new, rc_cur_id, rc_this_oldid, rc_last_oldid, rc_type, rc_source, rc_patrolled, rc_ip, rc_old_len, rc_new_len, rc_deleted, rc_logid, rc_log_type, rc_log_action, rc_params
-FROM /*_*/recentchanges;
-DROP TABLE /*_*/recentchanges;
-CREATE TABLE /*_*/recentchanges ( rc_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, rc_timestamp BLOB NOT NULL, rc_actor BIGINT UNSIGNED NOT NULL, rc_namespace INTEGER DEFAULT 0 NOT NULL, rc_title BLOB DEFAULT '' NOT NULL, rc_comment_id BIGINT UNSIGNED NOT NULL, rc_minor SMALLINT UNSIGNED DEFAULT 0 NOT NULL, rc_bot SMALLINT UNSIGNED DEFAULT 0 NOT NULL, rc_new SMALLINT UNSIGNED DEFAULT 0 NOT NULL, rc_cur_id INTEGER UNSIGNED DEFAULT 0 NOT NULL, rc_this_oldid INTEGER UNSIGNED DEFAULT 0 NOT NULL, rc_last_oldid INTEGER UNSIGNED DEFAULT 0 NOT NULL, rc_type SMALLINT UNSIGNED DEFAULT 0 NOT NULL, rc_source BLOB DEFAULT '' NOT NULL, rc_patrolled SMALLINT UNSIGNED DEFAULT 0 NOT NULL, rc_ip BLOB DEFAULT '' NOT NULL, rc_old_len INTEGER DEFAULT NULL, rc_new_len INTEGER DEFAULT NULL, rc_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL, rc_logid INTEGER UNSIGNED DEFAULT 0 NOT NULL, rc_log_type BLOB DEFAULT NULL, rc_log_action BLOB DEFAULT NULL, rc_params BLOB DEFAULT NULL );
-INSERT INTO /*_*/recentchanges ( rc_id, rc_timestamp, rc_actor, rc_namespace, rc_title, rc_comment_id, rc_minor, rc_bot, rc_new, rc_cur_id, rc_this_oldid, rc_last_oldid, rc_type, rc_source, rc_patrolled, rc_ip, rc_old_len, rc_new_len, rc_deleted, rc_logid, rc_log_type, rc_log_action, rc_params )
-SELECT rc_id, rc_timestamp, rc_actor, rc_namespace, rc_title, rc_comment_id, rc_minor, rc_bot, rc_new, rc_cur_id, rc_this_oldid, rc_last_oldid, rc_type, rc_source, rc_patrolled, rc_ip, rc_old_len, rc_new_len, rc_deleted, rc_logid, rc_log_type, rc_log_action, rc_params
-FROM /*_*/__temp__recentchanges;
-DROP TABLE /*_*/__temp__recentchanges;
-CREATE INDEX rc_timestamp ON /*_*/recentchanges (rc_timestamp);
-CREATE INDEX rc_namespace_title_timestamp ON /*_*/recentchanges ( rc_namespace, rc_title, rc_timestamp );
-CREATE INDEX rc_cur_id ON /*_*/recentchanges (rc_cur_id);
-CREATE INDEX rc_ip ON /*_*/recentchanges (rc_ip);
-CREATE INDEX rc_ns_actor ON /*_*/recentchanges (rc_namespace, rc_actor);
-CREATE INDEX rc_actor ON /*_*/recentchanges (rc_actor, rc_timestamp);
-CREATE INDEX rc_name_type_patrolled_timestamp ON /*_*/recentchanges ( rc_namespace, rc_type, rc_patrolled, rc_timestamp );
-CREATE INDEX rc_this_oldid ON /*_*/recentchanges (rc_this_oldid);
-CREATE INDEX rc_new_name_timestamp ON /*_*/recentchanges ( rc_new, rc_namespace, rc_timestamp ); \ No newline at end of file
+SELECT
+ rc_id,
+ rc_timestamp,
+ rc_actor,
+ rc_namespace,
+ rc_title,
+ rc_comment_id,
+ rc_minor,
+ rc_bot,
+ rc_new,
+ rc_cur_id,
+ rc_this_oldid,
+ rc_last_oldid,
+ rc_type,
+ rc_source,
+ rc_patrolled,
+ rc_ip,
+ rc_old_len,
+ rc_new_len,
+ rc_deleted,
+ rc_logid,
+ rc_log_type,
+ rc_log_action,
+ rc_params
+FROM /*_*/recentchanges;
+DROP TABLE /*_*/recentchanges;
+
+
+CREATE TABLE /*_*/recentchanges (
+ rc_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ rc_timestamp BLOB NOT NULL, rc_actor BIGINT UNSIGNED NOT NULL,
+ rc_namespace INTEGER DEFAULT 0 NOT NULL,
+ rc_title BLOB DEFAULT '' NOT NULL, rc_comment_id BIGINT UNSIGNED NOT NULL,
+ rc_minor SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ rc_bot SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ rc_new SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ rc_cur_id INTEGER UNSIGNED DEFAULT 0 NOT NULL,
+ rc_this_oldid INTEGER UNSIGNED DEFAULT 0 NOT NULL,
+ rc_last_oldid INTEGER UNSIGNED DEFAULT 0 NOT NULL,
+ rc_type SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ rc_source BLOB DEFAULT '' NOT NULL,
+ rc_patrolled SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ rc_ip BLOB DEFAULT '' NOT NULL, rc_old_len INTEGER DEFAULT NULL,
+ rc_new_len INTEGER DEFAULT NULL, rc_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ rc_logid INTEGER UNSIGNED DEFAULT 0 NOT NULL,
+ rc_log_type BLOB DEFAULT NULL, rc_log_action BLOB DEFAULT NULL,
+ rc_params BLOB DEFAULT NULL
+ );
+INSERT INTO /*_*/recentchanges (
+ rc_id, rc_timestamp, rc_actor, rc_namespace,
+ rc_title, rc_comment_id, rc_minor,
+ rc_bot, rc_new, rc_cur_id, rc_this_oldid,
+ rc_last_oldid, rc_type, rc_source,
+ rc_patrolled, rc_ip, rc_old_len,
+ rc_new_len, rc_deleted, rc_logid,
+ rc_log_type, rc_log_action, rc_params
+ )
+SELECT
+ rc_id,
+ rc_timestamp,
+ rc_actor,
+ rc_namespace,
+ rc_title,
+ rc_comment_id,
+ rc_minor,
+ rc_bot,
+ rc_new,
+ rc_cur_id,
+ rc_this_oldid,
+ rc_last_oldid,
+ rc_type,
+ rc_source,
+ rc_patrolled,
+ rc_ip,
+ rc_old_len,
+ rc_new_len,
+ rc_deleted,
+ rc_logid,
+ rc_log_type,
+ rc_log_action,
+ rc_params
+FROM
+ /*_*/__temp__recentchanges;
+DROP TABLE /*_*/__temp__recentchanges;
+
+CREATE INDEX rc_timestamp ON /*_*/recentchanges (rc_timestamp);
+
+CREATE INDEX rc_namespace_title_timestamp ON /*_*/recentchanges (
+ rc_namespace, rc_title, rc_timestamp
+ );
+
+CREATE INDEX rc_cur_id ON /*_*/recentchanges (rc_cur_id);
+
+CREATE INDEX rc_ip ON /*_*/recentchanges (rc_ip);
+
+CREATE INDEX rc_ns_actor ON /*_*/recentchanges (rc_namespace, rc_actor);
+
+CREATE INDEX rc_actor ON /*_*/recentchanges (rc_actor, rc_timestamp);
+
+CREATE INDEX rc_name_type_patrolled_timestamp ON /*_*/recentchanges (
+ rc_namespace, rc_type, rc_patrolled,
+ rc_timestamp
+ );
+
+CREATE INDEX rc_this_oldid ON /*_*/recentchanges (rc_this_oldid);
+
+CREATE INDEX rc_new_name_timestamp ON /*_*/recentchanges (
+ rc_new, rc_namespace, rc_timestamp
+ );
diff --git a/sql/sqlite/patch-revision-cleanup.sql b/sql/sqlite/patch-revision-cleanup.sql
index 0b070f11a755..51d69b7197a4 100644
--- a/sql/sqlite/patch-revision-cleanup.sql
+++ b/sql/sqlite/patch-revision-cleanup.sql
@@ -1,5 +1,5 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-revision-cleanup.json
+-- Source: sql/abstractSchemaChanges/patch-revision-cleanup.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__revision AS
diff --git a/sql/sqlite/patch-revision-rename-index.sql b/sql/sqlite/patch-revision-rename-index.sql
index b21293fd2a43..de9aeec03f85 100644
--- a/sql/sqlite/patch-revision-rename-index.sql
+++ b/sql/sqlite/patch-revision-rename-index.sql
@@ -1,23 +1,64 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-revision-rename-index.json
+-- Source: sql/abstractSchemaChanges/patch-revision-rename-index.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX rev_page_id;
-DROP INDEX rev_timestamp;
-DROP INDEX page_timestamp;
-DROP INDEX rev_actor_timestamp;
-DROP INDEX rev_page_actor_timestamp;
CREATE TEMPORARY TABLE /*_*/__temp__revision AS
-SELECT rev_id, rev_page, rev_comment_id, rev_actor, rev_timestamp, rev_minor_edit, rev_deleted, rev_len, rev_parent_id, rev_sha1
-FROM /*_*/revision;
-DROP TABLE /*_*/revision;
-CREATE TABLE /*_*/revision ( rev_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, rev_page INTEGER UNSIGNED NOT NULL, rev_comment_id BIGINT UNSIGNED DEFAULT 0 NOT NULL, rev_actor BIGINT UNSIGNED DEFAULT 0 NOT NULL, rev_timestamp BLOB DEFAULT '' NOT NULL, rev_minor_edit SMALLINT UNSIGNED DEFAULT 0 NOT NULL, rev_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL, rev_len INTEGER UNSIGNED DEFAULT NULL, rev_parent_id INTEGER UNSIGNED DEFAULT NULL, rev_sha1 BLOB DEFAULT '' NOT NULL );
-INSERT INTO /*_*/revision ( rev_id, rev_page, rev_comment_id, rev_actor, rev_timestamp, rev_minor_edit, rev_deleted, rev_len, rev_parent_id, rev_sha1 )
-SELECT rev_id, rev_page, rev_comment_id, rev_actor, rev_timestamp, rev_minor_edit, rev_deleted, rev_len, rev_parent_id, rev_sha1
-FROM /*_*/__temp__revision;
-DROP TABLE /*_*/__temp__revision;
-CREATE INDEX rev_page_id ON /*_*/revision (rev_page, rev_id);
-CREATE INDEX rev_timestamp ON /*_*/revision (rev_timestamp);
-CREATE INDEX rev_actor_timestamp ON /*_*/revision (rev_actor, rev_timestamp, rev_id);
-CREATE INDEX rev_page_actor_timestamp ON /*_*/revision ( rev_page, rev_actor, rev_timestamp );
-CREATE INDEX rev_page_timestamp ON /*_*/revision (rev_page, rev_timestamp); \ No newline at end of file
+SELECT
+ rev_id,
+ rev_page,
+ rev_comment_id,
+ rev_actor,
+ rev_timestamp,
+ rev_minor_edit,
+ rev_deleted,
+ rev_len,
+ rev_parent_id,
+ rev_sha1
+FROM /*_*/revision;
+DROP TABLE /*_*/revision;
+
+
+CREATE TABLE /*_*/revision (
+ rev_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ rev_page INTEGER UNSIGNED NOT NULL,
+ rev_comment_id BIGINT UNSIGNED DEFAULT 0 NOT NULL,
+ rev_actor BIGINT UNSIGNED DEFAULT 0 NOT NULL,
+ rev_timestamp BLOB DEFAULT '' NOT NULL,
+ rev_minor_edit SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ rev_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
+ rev_len INTEGER UNSIGNED DEFAULT NULL,
+ rev_parent_id INTEGER UNSIGNED DEFAULT NULL,
+ rev_sha1 BLOB DEFAULT '' NOT NULL
+ );
+INSERT INTO /*_*/revision (
+ rev_id, rev_page, rev_comment_id,
+ rev_actor, rev_timestamp, rev_minor_edit,
+ rev_deleted, rev_len, rev_parent_id,
+ rev_sha1
+ )
+SELECT
+ rev_id,
+ rev_page,
+ rev_comment_id,
+ rev_actor,
+ rev_timestamp,
+ rev_minor_edit,
+ rev_deleted,
+ rev_len,
+ rev_parent_id,
+ rev_sha1
+FROM
+ /*_*/__temp__revision;
+DROP TABLE /*_*/__temp__revision;
+
+CREATE INDEX rev_page_id ON /*_*/revision (rev_page, rev_id);
+
+CREATE INDEX rev_timestamp ON /*_*/revision (rev_timestamp);
+
+CREATE INDEX rev_actor_timestamp ON /*_*/revision (rev_actor, rev_timestamp, rev_id);
+
+CREATE INDEX rev_page_actor_timestamp ON /*_*/revision (
+ rev_page, rev_actor, rev_timestamp
+ );
+
+CREATE INDEX rev_page_timestamp ON /*_*/revision (rev_page, rev_timestamp);
diff --git a/sql/sqlite/patch-site_identifiers-rename-indexes.sql b/sql/sqlite/patch-site_identifiers-rename-indexes.sql
index e763a1faba02..914c10527360 100644
--- a/sql/sqlite/patch-site_identifiers-rename-indexes.sql
+++ b/sql/sqlite/patch-site_identifiers-rename-indexes.sql
@@ -1,17 +1,31 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-site_identifiers-rename-indexes.json
+-- Source: sql/abstractSchemaChanges/patch-site_identifiers-rename-indexes.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX site_ids_site;
-DROP INDEX site_ids_key;
CREATE TEMPORARY TABLE /*_*/__temp__site_identifiers AS
-SELECT si_type, si_key, si_site
-FROM /*_*/site_identifiers;
-DROP TABLE /*_*/site_identifiers;
-CREATE TABLE /*_*/site_identifiers ( si_type BLOB NOT NULL, si_key BLOB NOT NULL, si_site INTEGER UNSIGNED NOT NULL, PRIMARY KEY(si_type, si_key) );
-INSERT INTO /*_*/site_identifiers (si_type, si_key, si_site)
-SELECT si_type, si_key, si_site
-FROM /*_*/__temp__site_identifiers;
-DROP TABLE /*_*/__temp__site_identifiers;
-CREATE INDEX si_site ON /*_*/site_identifiers (si_site);
-CREATE INDEX si_key ON /*_*/site_identifiers (si_key); \ No newline at end of file
+SELECT
+ si_type,
+ si_key,
+ si_site
+FROM /*_*/site_identifiers;
+DROP TABLE /*_*/site_identifiers;
+
+
+CREATE TABLE /*_*/site_identifiers (
+ si_type BLOB NOT NULL,
+ si_key BLOB NOT NULL,
+ si_site INTEGER UNSIGNED NOT NULL,
+ PRIMARY KEY(si_type, si_key)
+ );
+INSERT INTO /*_*/site_identifiers (si_type, si_key, si_site)
+SELECT
+ si_type,
+ si_key,
+ si_site
+FROM
+ /*_*/__temp__site_identifiers;
+DROP TABLE /*_*/__temp__site_identifiers;
+
+CREATE INDEX si_site ON /*_*/site_identifiers (si_site);
+
+CREATE INDEX si_key ON /*_*/site_identifiers (si_key);
diff --git a/sql/sqlite/patch-sites-drop_indexes.sql b/sql/sqlite/patch-sites-drop_indexes.sql
index 1a92e6eec94f..20a364fe4997 100644
--- a/sql/sqlite/patch-sites-drop_indexes.sql
+++ b/sql/sqlite/patch-sites-drop_indexes.sql
@@ -1,5 +1,5 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-sites-drop_indexes.json
+-- Source: sql/abstractSchemaChanges/patch-sites-drop_indexes.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__sites AS
diff --git a/sql/sqlite/patch-sites-rename-indexes.sql b/sql/sqlite/patch-sites-rename-indexes.sql
index fdd09f141339..b32ab8f82c20 100644
--- a/sql/sqlite/patch-sites-rename-indexes.sql
+++ b/sql/sqlite/patch-sites-rename-indexes.sql
@@ -1,29 +1,71 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-sites-rename-indexes.json
+-- Source: sql/abstractSchemaChanges/patch-sites-rename-indexes.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX sites_global_key;
-DROP INDEX sites_type;
-DROP INDEX sites_group;
-DROP INDEX sites_source;
-DROP INDEX sites_language;
-DROP INDEX sites_protocol;
-DROP INDEX sites_domain;
-DROP INDEX sites_forward;
CREATE TEMPORARY TABLE /*_*/__temp__sites AS
-SELECT site_id, site_global_key, site_type, site_group, site_source, site_language, site_protocol, site_domain, site_data, site_forward, site_config
-FROM /*_*/sites;
-DROP TABLE /*_*/sites;
-CREATE TABLE /*_*/sites ( site_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, site_global_key BLOB NOT NULL, site_type BLOB NOT NULL, site_group BLOB NOT NULL, site_source BLOB NOT NULL, site_language BLOB NOT NULL, site_protocol BLOB NOT NULL, site_domain VARCHAR(255) NOT NULL, site_data BLOB NOT NULL, site_forward SMALLINT NOT NULL, site_config BLOB NOT NULL );
-INSERT INTO /*_*/sites ( site_id, site_global_key, site_type, site_group, site_source, site_language, site_protocol, site_domain, site_data, site_forward, site_config )
-SELECT site_id, site_global_key, site_type, site_group, site_source, site_language, site_protocol, site_domain, site_data, site_forward, site_config
-FROM /*_*/__temp__sites;
-DROP TABLE /*_*/__temp__sites;
-CREATE UNIQUE INDEX site_global_key ON /*_*/sites (site_global_key);
-CREATE INDEX site_type ON /*_*/sites (site_type);
-CREATE INDEX site_group ON /*_*/sites (site_group);
-CREATE INDEX site_source ON /*_*/sites (site_source);
-CREATE INDEX site_language ON /*_*/sites (site_language);
-CREATE INDEX site_protocol ON /*_*/sites (site_protocol);
-CREATE INDEX site_domain ON /*_*/sites (site_domain);
-CREATE INDEX site_forward ON /*_*/sites (site_forward); \ No newline at end of file
+SELECT
+ site_id,
+ site_global_key,
+ site_type,
+ site_group,
+ site_source,
+ site_language,
+ site_protocol,
+ site_domain,
+ site_data,
+ site_forward,
+ site_config
+FROM /*_*/sites;
+DROP TABLE /*_*/sites;
+
+
+CREATE TABLE /*_*/sites (
+ site_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ site_global_key BLOB NOT NULL,
+ site_type BLOB NOT NULL,
+ site_group BLOB NOT NULL,
+ site_source BLOB NOT NULL,
+ site_language BLOB NOT NULL,
+ site_protocol BLOB NOT NULL,
+ site_domain VARCHAR(255) NOT NULL,
+ site_data BLOB NOT NULL,
+ site_forward SMALLINT NOT NULL,
+ site_config BLOB NOT NULL
+ );
+INSERT INTO /*_*/sites (
+ site_id, site_global_key, site_type,
+ site_group, site_source, site_language,
+ site_protocol, site_domain, site_data,
+ site_forward, site_config
+ )
+SELECT
+ site_id,
+ site_global_key,
+ site_type,
+ site_group,
+ site_source,
+ site_language,
+ site_protocol,
+ site_domain,
+ site_data,
+ site_forward,
+ site_config
+FROM
+ /*_*/__temp__sites;
+DROP TABLE /*_*/__temp__sites;
+
+CREATE UNIQUE INDEX site_global_key ON /*_*/sites (site_global_key);
+
+CREATE INDEX site_type ON /*_*/sites (site_type);
+
+CREATE INDEX site_group ON /*_*/sites (site_group);
+
+CREATE INDEX site_source ON /*_*/sites (site_source);
+
+CREATE INDEX site_language ON /*_*/sites (site_language);
+
+CREATE INDEX site_protocol ON /*_*/sites (site_protocol);
+
+CREATE INDEX site_domain ON /*_*/sites (site_domain);
+
+CREATE INDEX site_forward ON /*_*/sites (site_forward);
diff --git a/sql/sqlite/patch-templatelinks-drop-tl_title.sql b/sql/sqlite/patch-templatelinks-drop-tl_title.sql
index 5bc26ae30893..509dedf09be2 100644
--- a/sql/sqlite/patch-templatelinks-drop-tl_title.sql
+++ b/sql/sqlite/patch-templatelinks-drop-tl_title.sql
@@ -1,19 +1,36 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-templatelinks-drop-tl_title.json
+-- Source: sql/abstractSchemaChanges/patch-templatelinks-drop-tl_title.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX tl_namespace;
-DROP INDEX tl_backlinks_namespace;
-DROP INDEX tl_target_id;
-DROP INDEX tl_backlinks_namespace_target_id;
CREATE TEMPORARY TABLE /*_*/__temp__templatelinks AS
-SELECT tl_from, tl_target_id, tl_from_namespace
-FROM /*_*/templatelinks;
-DROP TABLE /*_*/templatelinks;
-CREATE TABLE /*_*/templatelinks ( tl_from INTEGER UNSIGNED DEFAULT 0 NOT NULL, tl_target_id BIGINT UNSIGNED NOT NULL, tl_from_namespace INTEGER DEFAULT 0 NOT NULL, PRIMARY KEY(tl_from, tl_target_id) );
-INSERT INTO /*_*/templatelinks ( tl_from, tl_target_id, tl_from_namespace )
-SELECT tl_from, tl_target_id, tl_from_namespace
-FROM /*_*/__temp__templatelinks;
-DROP TABLE /*_*/__temp__templatelinks;
-CREATE INDEX tl_target_id ON /*_*/templatelinks (tl_target_id, tl_from);
-CREATE INDEX tl_backlinks_namespace_target_id ON /*_*/templatelinks ( tl_from_namespace, tl_target_id, tl_from ); \ No newline at end of file
+SELECT
+ tl_from,
+ tl_target_id,
+ tl_from_namespace
+FROM /*_*/templatelinks;
+DROP TABLE /*_*/templatelinks;
+
+
+CREATE TABLE /*_*/templatelinks (
+ tl_from INTEGER UNSIGNED DEFAULT 0 NOT NULL,
+ tl_target_id BIGINT UNSIGNED NOT NULL,
+ tl_from_namespace INTEGER DEFAULT 0 NOT NULL,
+ PRIMARY KEY(tl_from, tl_target_id)
+ );
+INSERT INTO /*_*/templatelinks (
+ tl_from, tl_target_id, tl_from_namespace
+ )
+SELECT
+ tl_from,
+ tl_target_id,
+ tl_from_namespace
+FROM
+ /*_*/__temp__templatelinks;
+DROP TABLE /*_*/__temp__templatelinks;
+
+CREATE INDEX tl_target_id ON /*_*/templatelinks (tl_target_id, tl_from);
+
+CREATE INDEX tl_backlinks_namespace_target_id ON /*_*/templatelinks (
+ tl_from_namespace, tl_target_id,
+ tl_from
+ );
diff --git a/sql/sqlite/patch-templatelinks-target_id.sql b/sql/sqlite/patch-templatelinks-target_id.sql
index d9e07830fdaa..ef19727ab70c 100644
--- a/sql/sqlite/patch-templatelinks-target_id.sql
+++ b/sql/sqlite/patch-templatelinks-target_id.sql
@@ -1,19 +1,47 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-templatelinks-target_id.json
+-- Source: sql/abstractSchemaChanges/patch-templatelinks-target_id.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX tl_namespace;
-DROP INDEX tl_backlinks_namespace;
CREATE TEMPORARY TABLE /*_*/__temp__templatelinks AS
-SELECT tl_from, tl_namespace, tl_title, tl_from_namespace
-FROM /*_*/templatelinks;
-DROP TABLE /*_*/templatelinks;
-CREATE TABLE /*_*/templatelinks ( 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, tl_target_id BIGINT UNSIGNED DEFAULT NULL, PRIMARY KEY(tl_from, tl_namespace, tl_title) );
-INSERT INTO /*_*/templatelinks ( tl_from, tl_namespace, tl_title, tl_from_namespace )
-SELECT tl_from, tl_namespace, tl_title, tl_from_namespace
-FROM /*_*/__temp__templatelinks;
-DROP TABLE /*_*/__temp__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 );
-CREATE INDEX tl_target_id ON /*_*/templatelinks (tl_target_id, tl_from);
-CREATE INDEX tl_backlinks_namespace_target_id ON /*_*/templatelinks ( tl_from_namespace, tl_target_id, tl_from ); \ No newline at end of file
+SELECT
+ tl_from,
+ tl_namespace,
+ tl_title,
+ tl_from_namespace
+FROM /*_*/templatelinks;
+DROP TABLE /*_*/templatelinks;
+
+
+CREATE TABLE /*_*/templatelinks (
+ 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,
+ tl_target_id BIGINT UNSIGNED DEFAULT NULL,
+ PRIMARY KEY(tl_from, tl_namespace, tl_title)
+ );
+INSERT INTO /*_*/templatelinks (
+ tl_from, tl_namespace, tl_title, tl_from_namespace
+ )
+SELECT
+ tl_from,
+ tl_namespace,
+ tl_title,
+ tl_from_namespace
+FROM
+ /*_*/__temp__templatelinks;
+DROP TABLE /*_*/__temp__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
+ );
+
+CREATE INDEX tl_target_id ON /*_*/templatelinks (tl_target_id, tl_from);
+
+CREATE INDEX tl_backlinks_namespace_target_id ON /*_*/templatelinks (
+ tl_from_namespace, tl_target_id,
+ tl_from
+ );
diff --git a/sql/sqlite/patch-templatelinks-tl_title-nullable.sql b/sql/sqlite/patch-templatelinks-tl_title-nullable.sql
index 0513f9e94637..01149c38a299 100644
--- a/sql/sqlite/patch-templatelinks-tl_title-nullable.sql
+++ b/sql/sqlite/patch-templatelinks-tl_title-nullable.sql
@@ -1,21 +1,50 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-templatelinks-tl_title-nullable.json
+-- Source: sql/abstractSchemaChanges/patch-templatelinks-tl_title-nullable.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX tl_namespace;
-DROP INDEX tl_backlinks_namespace;
-DROP INDEX tl_target_id;
-DROP INDEX tl_backlinks_namespace_target_id;
CREATE TEMPORARY TABLE /*_*/__temp__templatelinks AS
-SELECT tl_from, tl_namespace, tl_title, tl_from_namespace, tl_target_id
-FROM /*_*/templatelinks;
-DROP TABLE /*_*/templatelinks;
-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) );
-INSERT INTO /*_*/templatelinks ( tl_from, tl_namespace, tl_title, tl_from_namespace, tl_target_id )
-SELECT tl_from, tl_namespace, tl_title, tl_from_namespace, tl_target_id
-FROM /*_*/__temp__templatelinks;
-DROP TABLE /*_*/__temp__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 );
-CREATE INDEX tl_target_id ON /*_*/templatelinks (tl_target_id, tl_from);
-CREATE INDEX tl_backlinks_namespace_target_id ON /*_*/templatelinks ( tl_from_namespace, tl_target_id, tl_from ); \ No newline at end of file
+SELECT
+ tl_from,
+ tl_namespace,
+ tl_title,
+ tl_from_namespace,
+ tl_target_id
+FROM /*_*/templatelinks;
+DROP TABLE /*_*/templatelinks;
+
+
+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)
+ );
+INSERT INTO /*_*/templatelinks (
+ tl_from, tl_namespace, tl_title, tl_from_namespace,
+ tl_target_id
+ )
+SELECT
+ tl_from,
+ tl_namespace,
+ tl_title,
+ tl_from_namespace,
+ tl_target_id
+FROM
+ /*_*/__temp__templatelinks;
+DROP TABLE /*_*/__temp__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
+ );
+
+CREATE INDEX tl_target_id ON /*_*/templatelinks (tl_target_id, tl_from);
+
+CREATE INDEX tl_backlinks_namespace_target_id ON /*_*/templatelinks (
+ tl_from_namespace, tl_target_id,
+ tl_from
+ );
diff --git a/sql/sqlite/patch-uploadstash-us_size_to_bigint.sql b/sql/sqlite/patch-uploadstash-us_size_to_bigint.sql
index a760235d8c03..61610e8475c0 100644
--- a/sql/sqlite/patch-uploadstash-us_size_to_bigint.sql
+++ b/sql/sqlite/patch-uploadstash-us_size_to_bigint.sql
@@ -1,16 +1,81 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: abstractSchemaChanges/patch-uploadstash-us_size_to_bigint.json
+-- Source: sql/abstractSchemaChanges/patch-uploadstash-us_size_to_bigint.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__uploadstash AS
-SELECT us_id, us_user, us_key, us_orig_path, us_path, us_source_type, us_timestamp, us_status, us_chunk_inx, us_props, us_size, us_sha1, us_mime, us_media_type, us_image_width, us_image_height, us_image_bits
-FROM /*_*/uploadstash;
-DROP TABLE /*_*/uploadstash;
-CREATE TABLE /*_*/uploadstash ( us_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, us_user INTEGER UNSIGNED NOT NULL, us_key VARCHAR(255) NOT NULL, us_orig_path VARCHAR(255) NOT NULL, us_path VARCHAR(255) NOT NULL, us_source_type VARCHAR(50) DEFAULT NULL, us_timestamp BLOB NOT NULL, us_status VARCHAR(50) NOT NULL, us_chunk_inx INTEGER UNSIGNED DEFAULT NULL, us_props BLOB DEFAULT NULL, us_size BIGINT UNSIGNED NOT NULL, us_sha1 VARCHAR(31) NOT NULL, us_mime VARCHAR(255) DEFAULT NULL, us_media_type TEXT DEFAULT NULL, us_image_width INTEGER UNSIGNED DEFAULT NULL, us_image_height INTEGER UNSIGNED DEFAULT NULL, us_image_bits SMALLINT UNSIGNED DEFAULT NULL );
-INSERT INTO /*_*/uploadstash ( us_id, us_user, us_key, us_orig_path, us_path, us_source_type, us_timestamp, us_status, us_chunk_inx, us_props, us_size, us_sha1, us_mime, us_media_type, us_image_width, us_image_height, us_image_bits )
-SELECT us_id, us_user, us_key, us_orig_path, us_path, us_source_type, us_timestamp, us_status, us_chunk_inx, us_props, us_size, us_sha1, us_mime, us_media_type, us_image_width, us_image_height, us_image_bits
-FROM /*_*/__temp__uploadstash;
-DROP TABLE /*_*/__temp__uploadstash;
-CREATE INDEX us_user ON /*_*/uploadstash (us_user);
-CREATE UNIQUE INDEX us_key ON /*_*/uploadstash (us_key);
-CREATE INDEX us_timestamp ON /*_*/uploadstash (us_timestamp); \ No newline at end of file
+SELECT
+ us_id,
+ us_user,
+ us_key,
+ us_orig_path,
+ us_path,
+ us_source_type,
+ us_timestamp,
+ us_status,
+ us_chunk_inx,
+ us_props,
+ us_size,
+ us_sha1,
+ us_mime,
+ us_media_type,
+ us_image_width,
+ us_image_height,
+ us_image_bits
+FROM /*_*/uploadstash;
+DROP TABLE /*_*/uploadstash;
+
+
+CREATE TABLE /*_*/uploadstash (
+ us_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ us_user INTEGER UNSIGNED NOT NULL,
+ us_key VARCHAR(255) NOT NULL,
+ us_orig_path VARCHAR(255) NOT NULL,
+ us_path VARCHAR(255) NOT NULL,
+ us_source_type VARCHAR(50) DEFAULT NULL,
+ us_timestamp BLOB NOT NULL,
+ us_status VARCHAR(50) NOT NULL,
+ us_chunk_inx INTEGER UNSIGNED DEFAULT NULL,
+ us_props BLOB DEFAULT NULL,
+ us_size BIGINT UNSIGNED NOT NULL,
+ us_sha1 VARCHAR(31) NOT NULL,
+ us_mime VARCHAR(255) DEFAULT NULL,
+ us_media_type TEXT DEFAULT NULL,
+ us_image_width INTEGER UNSIGNED DEFAULT NULL,
+ us_image_height INTEGER UNSIGNED DEFAULT NULL,
+ us_image_bits SMALLINT UNSIGNED DEFAULT NULL
+ );
+INSERT INTO /*_*/uploadstash (
+ us_id, us_user, us_key, us_orig_path,
+ us_path, us_source_type, us_timestamp,
+ us_status, us_chunk_inx, us_props,
+ us_size, us_sha1, us_mime, us_media_type,
+ us_image_width, us_image_height,
+ us_image_bits
+ )
+SELECT
+ us_id,
+ us_user,
+ us_key,
+ us_orig_path,
+ us_path,
+ us_source_type,
+ us_timestamp,
+ us_status,
+ us_chunk_inx,
+ us_props,
+ us_size,
+ us_sha1,
+ us_mime,
+ us_media_type,
+ us_image_width,
+ us_image_height,
+ us_image_bits
+FROM
+ /*_*/__temp__uploadstash;
+DROP TABLE /*_*/__temp__uploadstash;
+
+CREATE INDEX us_user ON /*_*/uploadstash (us_user);
+
+CREATE UNIQUE INDEX us_key ON /*_*/uploadstash (us_key);
+
+CREATE INDEX us_timestamp ON /*_*/uploadstash (us_timestamp);
diff --git a/sql/sqlite/patch-user-user_editcount.sql b/sql/sqlite/patch-user-user_editcount.sql
index 3264feb2db9b..fb105df81c48 100644
--- a/sql/sqlite/patch-user-user_editcount.sql
+++ b/sql/sqlite/patch-user-user_editcount.sql
@@ -1,19 +1,74 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-user-user_editcount.json
+-- Source: sql/abstractSchemaChanges/patch-user-user_editcount.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX user_name;
-DROP INDEX user_email_token;
-DROP INDEX user_email;
CREATE TEMPORARY TABLE /*_*/__temp__user AS
-SELECT user_id, user_name, user_real_name, user_password, user_newpassword, user_newpass_time, user_email, user_touched, user_token, user_email_authenticated, user_email_token, user_email_token_expires, user_registration, user_editcount, user_password_expires
-FROM /*_*/user;
-DROP TABLE /*_*/user;
-CREATE TABLE /*_*/user ( user_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_name BLOB DEFAULT '' NOT NULL, user_real_name BLOB DEFAULT '' NOT NULL, user_password BLOB NOT NULL, user_newpassword BLOB NOT NULL, user_newpass_time BLOB DEFAULT NULL, user_email BLOB NOT NULL, user_touched BLOB NOT NULL, user_token BLOB DEFAULT '' NOT NULL, user_email_authenticated BLOB DEFAULT NULL, user_email_token BLOB DEFAULT NULL, user_email_token_expires BLOB DEFAULT NULL, user_registration BLOB DEFAULT NULL, user_editcount INTEGER UNSIGNED DEFAULT NULL, user_password_expires BLOB DEFAULT NULL );
-INSERT INTO /*_*/user ( user_id, user_name, user_real_name, user_password, user_newpassword, user_newpass_time, user_email, user_touched, user_token, user_email_authenticated, user_email_token, user_email_token_expires, user_registration, user_editcount, user_password_expires )
-SELECT user_id, user_name, user_real_name, user_password, user_newpassword, user_newpass_time, user_email, user_touched, user_token, user_email_authenticated, user_email_token, user_email_token_expires, user_registration, user_editcount, user_password_expires
-FROM /*_*/__temp__user;
-DROP TABLE /*_*/__temp__user;
-CREATE UNIQUE INDEX user_name ON /*_*/user (user_name);
-CREATE INDEX user_email_token ON /*_*/user (user_email_token);
-CREATE INDEX user_email ON /*_*/user (user_email); \ No newline at end of file
+SELECT
+ user_id,
+ user_name,
+ user_real_name,
+ user_password,
+ user_newpassword,
+ user_newpass_time,
+ user_email,
+ user_touched,
+ user_token,
+ user_email_authenticated,
+ user_email_token,
+ user_email_token_expires,
+ user_registration,
+ user_editcount,
+ user_password_expires
+FROM /*_*/user;
+DROP TABLE /*_*/user;
+
+
+CREATE TABLE /*_*/user (
+ user_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ user_name BLOB DEFAULT '' NOT NULL,
+ user_real_name BLOB DEFAULT '' NOT NULL,
+ user_password BLOB NOT NULL, user_newpassword BLOB NOT NULL,
+ user_newpass_time BLOB DEFAULT NULL,
+ user_email BLOB NOT NULL, user_touched BLOB NOT NULL,
+ user_token BLOB DEFAULT '' NOT NULL,
+ user_email_authenticated BLOB DEFAULT NULL,
+ user_email_token BLOB DEFAULT NULL,
+ user_email_token_expires BLOB DEFAULT NULL,
+ user_registration BLOB DEFAULT NULL,
+ user_editcount INTEGER UNSIGNED DEFAULT NULL,
+ user_password_expires BLOB DEFAULT NULL
+ );
+INSERT INTO /*_*/user (
+ user_id, user_name, user_real_name,
+ user_password, user_newpassword,
+ user_newpass_time, user_email, user_touched,
+ user_token, user_email_authenticated,
+ user_email_token, user_email_token_expires,
+ user_registration, user_editcount,
+ user_password_expires
+ )
+SELECT
+ user_id,
+ user_name,
+ user_real_name,
+ user_password,
+ user_newpassword,
+ user_newpass_time,
+ user_email,
+ user_touched,
+ user_token,
+ user_email_authenticated,
+ user_email_token,
+ user_email_token_expires,
+ user_registration,
+ user_editcount,
+ user_password_expires
+FROM
+ /*_*/__temp__user;
+DROP TABLE /*_*/__temp__user;
+
+CREATE UNIQUE INDEX user_name ON /*_*/user (user_name);
+
+CREATE INDEX user_email_token ON /*_*/user (user_email_token);
+
+CREATE INDEX user_email ON /*_*/user (user_email);
diff --git a/sql/sqlite/patch-user-user_is_temp.sql b/sql/sqlite/patch-user-user_is_temp.sql
index 4831c362d38f..fe3cb3d5415f 100644
--- a/sql/sqlite/patch-user-user_is_temp.sql
+++ b/sql/sqlite/patch-user-user_is_temp.sql
@@ -1,6 +1,6 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-user-user_is_temp.json
+-- Source: sql/abstractSchemaChanges/patch-user-user_is_temp.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-ALTER TABLE /*_*/user
-ADD COLUMN user_is_temp SMALLINT DEFAULT 0 NOT NULL; \ No newline at end of file
+ALTER TABLE /*_*/user
+ ADD COLUMN user_is_temp SMALLINT DEFAULT 0 NOT NULL;
diff --git a/sql/sqlite/patch-user_autocreate_serial-uas_year.sql b/sql/sqlite/patch-user_autocreate_serial-uas_year.sql
index 390a7dfd787b..085ee4b72cb2 100644
--- a/sql/sqlite/patch-user_autocreate_serial-uas_year.sql
+++ b/sql/sqlite/patch-user_autocreate_serial-uas_year.sql
@@ -1,5 +1,5 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-user_autocreate_serial-uas_year.json
+-- Source: sql/abstractSchemaChanges/patch-user_autocreate_serial-uas_year.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__user_autocreate_serial AS
diff --git a/sql/sqlite/patch-user_properties-rename-index.sql b/sql/sqlite/patch-user_properties-rename-index.sql
index 11ff1b737025..00df750580ce 100644
--- a/sql/sqlite/patch-user_properties-rename-index.sql
+++ b/sql/sqlite/patch-user_properties-rename-index.sql
@@ -1,15 +1,29 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-user_properties-rename-index.json
+-- Source: sql/abstractSchemaChanges/patch-user_properties-rename-index.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX user_properties_property;
CREATE TEMPORARY TABLE /*_*/__temp__user_properties AS
-SELECT up_user, up_property, up_value
-FROM /*_*/user_properties;
-DROP TABLE /*_*/user_properties;
-CREATE TABLE /*_*/user_properties ( up_user INTEGER UNSIGNED NOT NULL, up_property BLOB NOT NULL, up_value BLOB DEFAULT NULL, PRIMARY KEY(up_user, up_property) );
-INSERT INTO /*_*/user_properties (up_user, up_property, up_value)
-SELECT up_user, up_property, up_value
-FROM /*_*/__temp__user_properties;
-DROP TABLE /*_*/__temp__user_properties;
-CREATE INDEX up_property ON /*_*/user_properties (up_property); \ No newline at end of file
+SELECT
+ up_user,
+ up_property,
+ up_value
+FROM /*_*/user_properties;
+DROP TABLE /*_*/user_properties;
+
+
+CREATE TABLE /*_*/user_properties (
+ up_user INTEGER UNSIGNED NOT NULL,
+ up_property BLOB NOT NULL,
+ up_value BLOB DEFAULT NULL,
+ PRIMARY KEY(up_user, up_property)
+ );
+INSERT INTO /*_*/user_properties (up_user, up_property, up_value)
+SELECT
+ up_user,
+ up_property,
+ up_value
+FROM
+ /*_*/__temp__user_properties;
+DROP TABLE /*_*/__temp__user_properties;
+
+CREATE INDEX up_property ON /*_*/user_properties (up_property);
diff --git a/sql/sqlite/patch-user_table-updates.sql b/sql/sqlite/patch-user_table-updates.sql
index acaabbb08b74..8ec9ba2b0860 100644
--- a/sql/sqlite/patch-user_table-updates.sql
+++ b/sql/sqlite/patch-user_table-updates.sql
@@ -1,19 +1,74 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-user_table-updates.json
+-- Source: sql/abstractSchemaChanges/patch-user_table-updates.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX user_name;
-DROP INDEX user_email_token;
-DROP INDEX user_email;
CREATE TEMPORARY TABLE /*_*/__temp__user AS
-SELECT user_id, user_name, user_real_name, user_password, user_newpassword, user_newpass_time, user_email, user_touched, user_token, user_email_authenticated, user_email_token, user_email_token_expires, user_registration, user_editcount, user_password_expires
-FROM /*_*/user;
-DROP TABLE /*_*/user;
-CREATE TABLE /*_*/user ( user_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, user_password BLOB NOT NULL, user_newpassword BLOB NOT NULL, user_newpass_time BLOB DEFAULT NULL, user_email CLOB NOT NULL, user_token BLOB DEFAULT '' NOT NULL, user_email_authenticated BLOB DEFAULT NULL, user_email_token BLOB DEFAULT NULL, user_email_token_expires BLOB DEFAULT NULL, user_registration BLOB DEFAULT NULL, user_editcount INTEGER DEFAULT NULL, user_password_expires BLOB DEFAULT NULL, user_name BLOB DEFAULT '' NOT NULL, user_real_name BLOB DEFAULT '' NOT NULL, user_touched BLOB NOT NULL );
-INSERT INTO /*_*/user ( user_id, user_name, user_real_name, user_password, user_newpassword, user_newpass_time, user_email, user_touched, user_token, user_email_authenticated, user_email_token, user_email_token_expires, user_registration, user_editcount, user_password_expires )
-SELECT user_id, user_name, user_real_name, user_password, user_newpassword, user_newpass_time, user_email, user_touched, user_token, user_email_authenticated, user_email_token, user_email_token_expires, user_registration, user_editcount, user_password_expires
-FROM /*_*/__temp__user;
-DROP TABLE /*_*/__temp__user;
-CREATE UNIQUE INDEX user_name ON /*_*/user (user_name);
-CREATE INDEX user_email_token ON /*_*/user (user_email_token);
-CREATE INDEX user_email ON /*_*/user (user_email); \ No newline at end of file
+SELECT
+ user_id,
+ user_name,
+ user_real_name,
+ user_password,
+ user_newpassword,
+ user_newpass_time,
+ user_email,
+ user_touched,
+ user_token,
+ user_email_authenticated,
+ user_email_token,
+ user_email_token_expires,
+ user_registration,
+ user_editcount,
+ user_password_expires
+FROM /*_*/user;
+DROP TABLE /*_*/user;
+
+
+CREATE TABLE /*_*/user (
+ user_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ user_name BLOB DEFAULT '' NOT NULL,
+ user_real_name BLOB DEFAULT '' NOT NULL,
+ user_password BLOB NOT NULL, user_newpassword BLOB NOT NULL,
+ user_newpass_time BLOB DEFAULT NULL,
+ user_email CLOB NOT NULL, user_touched BLOB NOT NULL,
+ user_token BLOB DEFAULT '' NOT NULL,
+ user_email_authenticated BLOB DEFAULT NULL,
+ user_email_token BLOB DEFAULT NULL,
+ user_email_token_expires BLOB DEFAULT NULL,
+ user_registration BLOB DEFAULT NULL,
+ user_editcount INTEGER DEFAULT NULL,
+ user_password_expires BLOB DEFAULT NULL
+ );
+INSERT INTO /*_*/user (
+ user_id, user_name, user_real_name,
+ user_password, user_newpassword,
+ user_newpass_time, user_email, user_touched,
+ user_token, user_email_authenticated,
+ user_email_token, user_email_token_expires,
+ user_registration, user_editcount,
+ user_password_expires
+ )
+SELECT
+ user_id,
+ user_name,
+ user_real_name,
+ user_password,
+ user_newpassword,
+ user_newpass_time,
+ user_email,
+ user_touched,
+ user_token,
+ user_email_authenticated,
+ user_email_token,
+ user_email_token_expires,
+ user_registration,
+ user_editcount,
+ user_password_expires
+FROM
+ /*_*/__temp__user;
+DROP TABLE /*_*/__temp__user;
+
+CREATE UNIQUE INDEX user_name ON /*_*/user (user_name);
+
+CREATE INDEX user_email_token ON /*_*/user (user_email_token);
+
+CREATE INDEX user_email ON /*_*/user (user_email);
diff --git a/sql/sqlite/patch-watchlist-namespace_title-rename-index.sql b/sql/sqlite/patch-watchlist-namespace_title-rename-index.sql
index ad89c87b3ecd..006a6b6c10e7 100644
--- a/sql/sqlite/patch-watchlist-namespace_title-rename-index.sql
+++ b/sql/sqlite/patch-watchlist-namespace_title-rename-index.sql
@@ -1,19 +1,42 @@
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
--- Source: maintenance/abstractSchemaChanges/patch-watchlist-namespace_title-rename-index.json
+-- Source: sql/abstractSchemaChanges/patch-watchlist-namespace_title-rename-index.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
-DROP INDEX wl_user;
-DROP INDEX namespace_title;
-DROP INDEX wl_user_notificationtimestamp;
CREATE TEMPORARY TABLE /*_*/__temp__watchlist AS
-SELECT wl_id, wl_user, wl_namespace, wl_title, wl_notificationtimestamp
-FROM /*_*/watchlist;
-DROP TABLE /*_*/watchlist;
-CREATE TABLE /*_*/watchlist ( wl_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, wl_user INTEGER UNSIGNED NOT NULL, wl_namespace INTEGER DEFAULT 0 NOT NULL, wl_title BLOB DEFAULT '' NOT NULL, wl_notificationtimestamp BLOB DEFAULT NULL );
-INSERT INTO /*_*/watchlist ( wl_id, wl_user, wl_namespace, wl_title, wl_notificationtimestamp )
-SELECT wl_id, wl_user, wl_namespace, wl_title, wl_notificationtimestamp
-FROM /*_*/__temp__watchlist;
-DROP TABLE /*_*/__temp__watchlist;
-CREATE UNIQUE INDEX wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
-CREATE INDEX wl_user_notificationtimestamp ON /*_*/watchlist ( wl_user, wl_notificationtimestamp );
-CREATE INDEX wl_namespace_title ON /*_*/watchlist (wl_namespace, wl_title); \ No newline at end of file
+SELECT
+ wl_id,
+ wl_user,
+ wl_namespace,
+ wl_title,
+ wl_notificationtimestamp
+FROM /*_*/watchlist;
+DROP TABLE /*_*/watchlist;
+
+
+CREATE TABLE /*_*/watchlist (
+ wl_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ wl_user INTEGER UNSIGNED NOT NULL,
+ wl_namespace INTEGER DEFAULT 0 NOT NULL,
+ wl_title BLOB DEFAULT '' NOT NULL, wl_notificationtimestamp BLOB DEFAULT NULL
+ );
+INSERT INTO /*_*/watchlist (
+ wl_id, wl_user, wl_namespace, wl_title,
+ wl_notificationtimestamp
+ )
+SELECT
+ wl_id,
+ wl_user,
+ wl_namespace,
+ wl_title,
+ wl_notificationtimestamp
+FROM
+ /*_*/__temp__watchlist;
+DROP TABLE /*_*/__temp__watchlist;
+
+CREATE UNIQUE INDEX wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
+
+CREATE INDEX wl_user_notificationtimestamp ON /*_*/watchlist (
+ wl_user, wl_notificationtimestamp
+ );
+
+CREATE INDEX wl_namespace_title ON /*_*/watchlist (wl_namespace, wl_title);