Followup r81311, add MysqlUpdater function to update ll_lang length if it's still 10
authorSam Reed <reedy@users.mediawiki.org>
Tue, 1 Feb 2011 18:58:32 +0000 (18:58 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 1 Feb 2011 18:58:32 +0000 (18:58 +0000)
includes/installer/MysqlUpdater.php

index 5cfd628..db101da 100644 (file)
@@ -173,6 +173,7 @@ class MysqlUpdater extends DatabaseUpdater {
                        array( 'addTable', 'module_deps',                       'patch-module_deps.sql' ),
                        array( 'dropIndex', 'archive', 'ar_page_revid',         'patch-archive_kill_ar_page_revid.sql' ),
                        array( 'addIndex', 'archive', 'ar_revid',               'patch-archive_ar_revid.sql' ),
+                       array( 'doLangLinksLengthUpdate' ),
                );
        }
 
@@ -813,4 +814,18 @@ class MysqlUpdater extends DatabaseUpdater {
                $this->applyPatch( 'patch-categorylinks-better-collation2.sql' );
                $this->output( "done.\n" );
        }
+
+       protected function doLangLinksLengthUpdate() {
+               $langlinks = $this->db->tableName( 'langlinks' );
+               $res = $this->db->query( "SHOW COLUMNS FROM $langlinks LIKE 'll_lang'" );
+               $row = $this->db->fetchObject( $res );
+
+               if ( $row && $row->Type == "varbinary(210)" ) {
+                       $this->output( 'Updating length of ll_lang in langlinks...' );
+                       $this->applyPatch( 'patch-langlinks-ll_lang-20.sql' );
+                       $this->output( "done.\n" );
+               } else {
+                       $this->output( "...ll_lang is up-to-date.\n" );
+               }
+       }
 }