Don't trigger MessageBlobStore during tests
[lhc/web/wiklou.git] / includes / installer / MysqlUpdater.php
index 7a36f01..36d2c1d 100644 (file)
@@ -37,7 +37,6 @@ class MysqlUpdater extends DatabaseUpdater {
                        array( 'addField', 'ipblocks', 'ipb_expiry', 'patch-ipb_expiry.sql' ),
                        array( 'doInterwikiUpdate' ),
                        array( 'doIndexUpdate' ),
-                       array( 'addTable', 'hitcounter', 'patch-hitcounter.sql' ),
                        array( 'addField', 'recentchanges', 'rc_type', 'patch-rc_type.sql' ),
                        array( 'addIndex', 'recentchanges', 'new_name_timestamp', 'patch-rc-newindex.sql' ),
 
@@ -271,6 +270,9 @@ class MysqlUpdater extends DatabaseUpdater {
                        array( 'dropTable', 'hitcounter' ),
                        array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ),
                        array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ),
+                       array( 'doUserNewTalkUseridUnsigned' ),
+                       // note this patch covers other _comment and _description fields too
+                       array( 'modifyField', 'recentchanges', 'rc_comment', 'patch-editsummary-length.sql' ),
                );
        }
 
@@ -1063,4 +1065,26 @@ class MysqlUpdater extends DatabaseUpdater {
                        'Making iwl_prefix_title_from index non-UNIQUE'
                );
        }
+
+       protected function doUserNewTalkUseridUnsigned() {
+               if ( !$this->doTable( 'user_newtalk' ) ) {
+                       return true;
+               }
+
+               $info = $this->db->fieldInfo( 'user_newtalk', 'user_id' );
+               if ( $info === false ) {
+                       return true;
+               }
+               if ( $info->isUnsigned() ) {
+                       $this->output( "...user_id is already unsigned int.\n" );
+
+                       return true;
+               }
+
+               return $this->applyPatch(
+                       'patch-user-newtalk-userid-unsigned.sql',
+                       false,
+                       'Making user_id unsigned int'
+               );
+       }
 }