Merge "Fix patchfile used to add newtalk table on mysql"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 29 Sep 2017 05:31:59 +0000 (05:31 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 29 Sep 2017 05:31:59 +0000 (05:31 +0000)
1  2 
includes/installer/MysqlUpdater.php

@@@ -83,7 -83,7 +83,7 @@@ class MysqlUpdater extends DatabaseUpda
                        [ 'doUserUniqueUpdate' ],
                        [ 'doUserGroupsUpdate' ],
                        [ 'addField', 'site_stats', 'ss_total_pages', 'patch-ss_total_articles.sql' ],
-                       [ 'addTable', 'user_newtalk', 'patch-usernewtalk2.sql' ],
+                       [ 'addTable', 'user_newtalk', 'patch-usernewtalk.sql' ],
                        [ 'addTable', 'transcache', 'patch-transcache.sql' ],
                        [ 'addField', 'interwiki', 'iw_trans', 'patch-interwiki-trans.sql' ],
  
  
                        // 1.25
                        // note this patch covers other _comment and _description fields too
 -                      [ 'modifyField', 'recentchanges', 'rc_comment', 'patch-editsummary-length.sql' ],
 +                      [ 'doExtendCommentLengths' ],
  
                        // 1.26
                        [ 'dropTable', 'hitcounter' ],
                global $IP;
  
                if ( !$this->doTable( 'interwiki' ) ) {
 -                      return true;
 +                      return;
                }
  
                if ( $this->db->tableExists( "interwiki", __METHOD__ ) ) {
                );
        }
  
 +      protected function doExtendCommentLengths() {
 +              $table = $this->db->tableName( 'revision' );
 +              $res = $this->db->query( "SHOW COLUMNS FROM $table LIKE 'rev_comment'" );
 +              $row = $this->db->fetchObject( $res );
 +
 +              if ( $row && ( $row->Type !== "varbinary(767)" || $row->Default !== "" ) ) {
 +                      $this->applyPatch(
 +                              'patch-editsummary-length.sql',
 +                              false,
 +                              'Extending edit summary lengths (and setting defaults)'
 +                      );
 +              } else {
 +                      $this->output( '...comment fields are up to date' );
 +              }
 +      }
 +
        public function getSchemaVars() {
                global $wgDBTableOptions;