X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=blobdiff_plain;f=includes%2Finstaller%2FMysqlUpdater.php;h=e2ff9604a2330206b2f55b4ec75fb9720beee3ac;hb=e6a77bb2d45ce24eb1832957eae73dfd882afc69;hp=2abc6b61db62016d41a009726fb4261085e06074;hpb=61edfb56d2b212888e60cb08961df54f2c79a0de;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index 2abc6b61db..e2ff9604a2 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -267,7 +267,7 @@ class MysqlUpdater extends DatabaseUpdater { // 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' ], @@ -1181,6 +1181,22 @@ class MysqlUpdater extends DatabaseUpdater { ); } + 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;