Localisation updates from https://translatewiki.net.
[mediawiki.git] / includes / installer / SqliteUpdater.php
blob162286adf5bdfad55f52c4cf1a4c4bc61da28f7a
1 <?php
3 /**
4 * Sqlite-specific updater.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 * http://www.gnu.org/copyleft/gpl.html
21 * @file
22 * @ingroup Installer
25 namespace MediaWiki\Installer;
27 use FixInconsistentRedirects;
28 use MediaWiki\Maintenance\FixAutoblockLogTitles;
29 use MigrateExternallinks;
30 use MigrateRevisionActorTemp;
31 use MigrateRevisionCommentTemp;
32 use PopulateUserIsTemp;
33 use UpdateRestrictions;
35 /**
36 * Class for handling updates to Sqlite databases.
38 * @ingroup Installer
39 * @since 1.17
40 * @property \Wikimedia\Rdbms\DatabaseSqlite $db
42 class SqliteUpdater extends DatabaseUpdater {
44 protected function getCoreUpdateList() {
45 return [
46 // 1.36
47 [ 'modifyField', 'content', 'content_id', 'patch-content-content_id-fix_not_null.sql' ],
48 [ 'modifyField', 'redirect', 'rd_title', 'patch-redirect-rd_title-varbinary.sql' ],
49 [ 'modifyField', 'pagelinks', 'pl_title', 'patch-pagelinks-pl_title-varbinary.sql' ],
50 [ 'modifyField', 'templatelinks', 'tl_title', 'patch-templatelinks-tl_title-varbinary.sql' ],
51 [ 'modifyField', 'imagelinks', 'il_to', 'patch-imagelinks-il_to-varbinary.sql' ],
52 [ 'modifyField', 'langlinks', 'll_title', 'patch-langlinks-ll_title-varbinary.sql' ],
53 [ 'modifyField', 'iwlinks', 'iwl_title', 'patch-iwlinks-iwl_title-varbinary.sql' ],
54 [ 'modifyField', 'category', 'cat_title', 'patch-category-cat_title-varbinary.sql' ],
55 [ 'modifyField', 'querycache', 'qc_title', 'patch-querycache-qc_title-varbinary.sql' ],
56 [ 'modifyField', 'querycachetwo', 'qcc_title', 'patch-querycachetwo-qcc_title-varbinary.sql' ],
57 [ 'modifyField', 'watchlist', 'wl_title', 'patch-watchlist-wl_title-varbinary.sql' ],
58 [ 'modifyField', 'protected_titles', 'pt_title', 'patch-protected_titles-pt_title-varbinary.sql' ],
59 [ 'modifyField', 'protected_titles', 'pt_expiry', 'patch-protected_titles-pt_expiry-drop-default.sql' ],
60 [ 'modifyField', 'ip_changes', 'ipc_rev_timestamp', 'patch-ip_changes-pc_rev_timestamp-drop-default.sql' ],
61 [ 'renameIndex', 'watchlist', 'namespace_title', 'wl_namespace_title', false,
62 'patch-watchlist-namespace_title-rename-index.sql' ],
63 [ 'modifyField', 'job', 'job_title', 'patch-job-job_title-varbinary.sql' ],
64 [ 'modifyField', 'slot_roles', 'role_id', 'patch-slot_roles-role_id-fix_not_null.sql' ],
65 [ 'modifyField', 'content_models', 'model_id', 'patch-content_models-model_id-fix_not_null.sql' ],
66 [ 'modifyField', 'categorylinks', 'cl_to', 'patch-categorylinks-cl_to-varbinary.sql' ],
67 [ 'modifyField', 'logging', 'log_title', 'patch-logging-log_title-varbinary.sql' ],
68 [ 'renameIndex', 'user_properties', 'user_properties_property', 'up_property', false,
69 'patch-user_properties-rename-index.sql' ],
70 [ 'renameIndex', 'sites', 'sites_global_key', 'site_global_key', false, 'patch-sites-rename-indexes.sql' ],
71 [ 'renameIndex', 'logging', 'type_time', 'log_type_time', false, 'patch-logging-rename-indexes.sql' ],
72 [ 'modifyField', 'filearchive', 'fa_name', 'patch-filearchive-fa_name.sql' ],
73 [ 'modifyField', 'oldimage', 'oi_name', 'patch-oldimage-oi_name-varbinary.sql' ],
74 [ 'modifyField', 'objectcache', 'exptime', 'patch-objectcache-exptime-notnull.sql' ],
75 [ 'modifyField', 'ipblocks', 'ipb_timestamp', 'patch-ipblocks-ipb_timestamp-drop-default.sql' ],
76 [ 'renameIndex', 'archive', 'name_title_timestamp', 'ar_name_title_timestamp', false,
77 'patch-archive-rename-name_title_timestamp-index.sql' ],
78 [ 'modifyField', 'image', 'img_name', 'patch-image-img_name-varbinary.sql' ],
79 [ 'renameIndex', 'site_identifiers', 'site_ids_key', 'si_key', false,
80 'patch-site_identifiers-rename-indexes.sql' ],
81 [ 'modifyField', 'recentchanges', 'rc_title', 'patch-recentchanges-rc_title-varbinary.sql' ],
82 [ 'renameIndex', 'recentchanges', 'new_name_timestamp', 'rc_new_name_timestamp', false,
83 'patch-recentchanges-rc_new_name_timestamp.sql' ],
84 [ 'modifyField', 'archive', 'ar_title', 'patch-archive-ar_title-varbinary.sql' ],
85 [ 'modifyField', 'page', 'page_title', 'patch-page-page_title-varbinary.sql' ],
86 [ 'modifyField', 'user', 'user_name', 'patch-user_table-updates.sql' ],
88 // 1.37
89 [ 'renameIndex', 'revision', 'page_timestamp', 'rev_page_timestamp', false,
90 'patch-revision-rename-index.sql' ],
91 [ 'addField', 'objectcache', 'modtoken', 'patch-objectcache-modtoken.sql' ],
92 [ 'modifyField', 'revision', 'rev_timestamp', 'patch-revision-rev_timestamp-drop-default.sql' ],
93 [ 'addIndex', 'oldimage', 'oi_timestamp', 'patch-oldimage-oi_timestamp.sql' ],
94 [ 'renameIndex', 'page', 'name_title', 'page_name_title', false,
95 'patch-page-rename-name_title-index.sql' ],
96 [ 'renameIndex', 'change_tag', 'change_tag_rc_tag_id', 'ct_rc_tag_id', false,
97 'patch-change_tag-rename-indexes.sql' ],
99 // 1.38
100 [ 'doConvertDjvuMetadata' ],
101 [ 'dropField', 'page_restrictions', 'pr_user', 'patch-drop-page_restrictions-pr_user.sql' ],
102 [ 'addTable', 'linktarget', 'patch-linktarget.sql' ],
103 [ 'dropIndex', 'revision', 'rev_page_id', 'patch-drop-rev_page_id.sql' ],
104 [ 'modifyField', 'page_restrictions', 'pr_page', 'patch-page_restrictions-pr_page.sql' ],
105 [ 'modifyField', 'page_props', 'pp_page', 'patch-page_props-pp_page.sql' ],
106 [ 'modifyField', 'ipblocks_restrictions', 'ir_value', 'patch-ipblocks_restrictions-ir_value.sql' ],
107 [ 'addField', 'templatelinks', 'tl_target_id', 'patch-templatelinks-target_id.sql' ],
109 // 1.39
110 [ 'addTable', 'user_autocreate_serial', 'patch-user_autocreate_serial.sql' ],
111 [ 'modifyField', 'ipblocks_restrictions', 'ir_ipb_id', 'patch-ipblocks_restrictions-ir_ipb_id.sql' ],
112 [ 'modifyField', 'ipblocks', 'ipb_id', 'patch-ipblocks-ipb_id.sql' ],
113 [ 'modifyField', 'user', 'user_editcount', 'patch-user-user_editcount.sql' ],
114 [ 'runMaintenance', MigrateRevisionActorTemp::class ],
115 [ 'dropTable', 'revision_actor_temp' ],
116 [ 'runMaintenance', UpdateRestrictions::class ],
117 [ 'dropField', 'page', 'page_restrictions', 'patch-page-drop-page_restrictions.sql' ],
118 [ 'migrateTemplatelinks' ],
119 [ 'modifyField', 'templatelinks', 'tl_namespace', 'patch-templatelinks-tl_title-nullable.sql' ],
120 [ 'dropField', 'templatelinks', 'tl_title', 'patch-templatelinks-drop-tl_title.sql' ],
122 // 1.40
123 [ 'addField', 'externallinks', 'el_to_path', 'patch-externallinks-el_to_path.sql' ],
125 // 1.41
126 [ 'addField', 'user', 'user_is_temp', 'patch-user-user_is_temp.sql' ],
127 [ 'runMaintenance', MigrateRevisionCommentTemp::class ],
128 [ 'dropTable', 'revision_comment_temp' ],
129 [ 'runMaintenance', MigrateExternallinks::class ],
130 [ 'modifyField', 'externallinks', 'el_to', 'patch-externallinks-el_to_default.sql' ],
131 [ 'addField', 'pagelinks', 'pl_target_id', 'patch-pagelinks-target_id.sql' ],
132 [ 'dropField', 'externallinks', 'el_to', 'patch-externallinks-drop-el_to.sql' ],
133 [ 'runMaintenance', FixInconsistentRedirects::class ],
134 [ 'modifyField', 'image', 'img_size', 'patch-image-img_size_to_bigint.sql' ],
135 [ 'modifyField', 'filearchive', 'fa_size', 'patch-filearchive-fa_size_to_bigint.sql' ],
136 [ 'modifyField', 'oldimage', 'oi_size', 'patch-oldimage-oi_size_to_bigint.sql' ],
137 [ 'modifyField', 'uploadstash', 'us_size', 'patch-uploadstash-us_size_to_bigint.sql' ],
139 // 1.42
140 [ 'addField', 'user_autocreate_serial', 'uas_year', 'patch-user_autocreate_serial-uas_year.sql' ],
141 [ 'addTable', 'block_target', 'patch-block_target.sql' ],
142 [ 'dropIndex', 'categorylinks', 'cl_collation_ext', 'patch-drop-cl_collation_ext.sql' ],
143 [ 'runMaintenance', PopulateUserIsTemp::class ],
144 [ 'dropIndex', 'sites', 'site_type', 'patch-sites-drop_indexes.sql' ],
145 [ 'dropIndex', 'iwlinks', 'iwl_prefix_from_title', 'patch-iwlinks-drop-iwl_prefix_from_title.sql' ],
147 // 1.43
148 [ 'migratePagelinks' ],
149 [ 'modifyField', 'revision', 'rev_id', 'patch-revision-cleanup.sql' ],
150 [ 'modifyField', 'change_tag', 'ct_rc_id', 'patch-change_tag-ct_rc_id.sql' ],
151 [ 'runMaintenance', \MigrateBlocks::class ],
152 [ 'dropTable', 'ipblocks' ],
153 [ 'dropField', 'pagelinks', 'pl_title', 'patch-pagelinks-drop-pl_title.sql' ],
154 [ 'addPostDatabaseUpdateMaintenance', FixAutoblockLogTitles::class ],
158 protected function getInitialUpdateKeys() {
159 return [
160 'filearchive-fa_major_mime-patch-fa_major_mime-chemical.sql',
161 'image-img_major_mime-patch-img_major_mime-chemical.sql',
162 'oldimage-oi_major_mime-patch-oi_major_mime-chemical.sql',
163 'user_groups-ug_group-patch-ug_group-length-increase-255.sql',
164 'user_former_groups-ufg_group-patch-ufg_group-length-increase-255.sql',
165 'user_properties-up_property-patch-up_property.sql',