Fix message cache expiry semantics
[lhc/web/wiklou.git] / includes / installer / MysqlUpdater.php
index 9978a92..df1f610 100644 (file)
@@ -165,12 +165,10 @@ class MysqlUpdater extends DatabaseUpdater {
                        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
@@ -179,7 +177,6 @@ class MysqlUpdater extends DatabaseUpdater {
                        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' ),
@@ -229,6 +226,11 @@ class MysqlUpdater extends DatabaseUpdater {
                        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' ),
                );
        }
 
@@ -846,15 +848,6 @@ class MysqlUpdater extends DatabaseUpdater {
                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" );
@@ -901,4 +894,18 @@ class MysqlUpdater extends DatabaseUpdater {
 
                $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" );
+       }
 }