array( 'doLogUsertextPopulation' ), # listed separately from the previous update because 1.16 was released without this update
array( 'doLogSearchPopulation' ),
array( 'addTable', 'l10n_cache', 'patch-l10n_cache.sql' ),
- array( 'addTable', 'external_user', 'patch-external_user.sql' ),
array( 'addIndex', 'log_search', 'ls_field_val', 'patch-log_search-rename-index.sql' ),
array( 'addIndex', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ),
array( 'addField', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ),
array( 'doUpdateTranscacheField' ),
- array( 'renameEuWikiId' ),
array( 'doUpdateMimeMinorField' ),
// 1.17
array( 'addField', 'updatelog', 'ul_value', 'patch-ul_value.sql' ),
array( 'addField', 'interwiki', 'iw_api', 'patch-iw_api_and_wikiid.sql' ),
array( 'dropIndex', 'iwlinks', 'iwl_prefix', 'patch-kill-iwl_prefix.sql' ),
- array( 'dropIndex', 'iwlinks', 'iwl_prefix_from_title', 'patch-kill-iwl_pft.sql' ),
array( 'addField', 'categorylinks', 'cl_collation', 'patch-categorylinks-better-collation.sql' ),
array( 'doClFieldsUpdate' ),
array( 'doCollationUpdate' ),
array( 'modifyField', 'user_groups', 'ug_group', 'patch-ug_group-length-increase-255.sql' ),
array( 'modifyField', 'user_former_groups', 'ufg_group', 'patch-ufg_group-length-increase-255.sql' ),
array( 'addIndex', 'page_props', 'pp_propname_page', 'patch-page_props-propname-page-index.sql' ),
+ array( 'addIndex', 'image', 'img_media_mime', 'patch-img_media_mime-index.sql' ),
+
+ // 1.22
+ array( 'doIwlinksIndexNonUnique' ),
+ array( 'addIndex', 'iwlinks', 'iwl_prefix_from_title', 'patch-iwlinks-from-title-index.sql' ),
);
}
* 1.4 betas were missing the 'binary' marker from logging.log_title,
* which causes a collation mismatch error on joins in MySQL 4.1.
*
- * @param $table String: table name
- * @param $field String: field name to check
- * @param $patchFile String: path to the patch to correct the field
+ * @param string $table table name
+ * @param string $field field name to check
+ * @param string $patchFile path to the patch to correct the field
*/
protected function checkBin( $table, $field, $patchFile ) {
if ( !$this->doTable( $table ) ) {
/**
* Check whether an index contain a field
*
- * @param $table String: table name
- * @param $index String: index name to check
- * @param $field String: field that should be in the index
+ * @param string $table table name
+ * @param string $index index name to check
+ * @param string $field field that should be in the index
* @return Boolean
*/
protected function indexHasField( $table, $index, $field ) {
return $this->applyPatch( 'patch-pl-tl-il-unique.sql', false, "Making pl_namespace, tl_namespace and il_to indices UNIQUE" );
}
- protected function renameEuWikiId() {
- if ( $this->db->fieldExists( 'external_user', 'eu_local_id', __METHOD__ ) ) {
- $this->output( "...eu_wiki_id already renamed to eu_local_id.\n" );
- return;
- }
-
- $this->applyPatch( 'patch-eu_local_id.sql', false, "Renaming eu_wiki_id -> eu_local_id" );
- }
-
protected function doUpdateMimeMinorField() {
if ( $this->updateRowExists( 'mime_minor_length' ) ) {
$this->output( "...*_mime_minor fields are already long enough.\n" );
$this->applyPatch( 'patch-user-newtalk-timestamp-null.sql', false, "Making user_last_timestamp nullable" );
}
+
+ protected function doIwlinksIndexNonUnique() {
+ $info = $this->db->indexInfo( 'iwlinks', 'iwl_prefix_title_from' );
+ if ( is_array( $info ) && $info[0]->Non_unique ) {
+ $this->output( "...iwl_prefix_title_from index is already non-UNIQUE.\n" );
+ return true;
+ }
+ if ( $this->skipSchema ) {
+ $this->output( "...skipping schema change (making iwl_prefix_title_from index non-UNIQUE).\n" );
+ return false;
+ }
+
+ return $this->applyPatch( 'patch-iwl_prefix_title_from-non-unique.sql', false, "Making iwl_prefix_title_from index non-UNIQUE" );
+ }
}