Follow-up r94289: SQLite support, unbreaks tests
authorMax Semenik <maxsem@users.mediawiki.org>
Fri, 12 Aug 2011 13:16:06 +0000 (13:16 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Fri, 12 Aug 2011 13:16:06 +0000 (13:16 +0000)
includes/installer/DatabaseUpdater.php
includes/installer/MysqlUpdater.php
includes/installer/SqliteUpdater.php
maintenance/populateRevisionSha1.php

index e4108fa..4a93910 100644 (file)
@@ -573,4 +573,14 @@ abstract class DatabaseUpdater {
                $task = $this->maintenance->runChild( 'UpdateCollation' );
                $task->execute();
        }
+
+       protected function doPopulateRevSha1() {
+               if ( $this->updateRowExists( 'populate rev_sha1' ) ) {
+                       $this->output( "...rev_sha1/ar_sha1 columns already populated.\n" );
+                       return;
+               }
+
+               $task = $this->maintenance->runChild( 'PopulateRevisionSha1' );
+               $task->execute();
+       }
 }
index f95351f..8acfce1 100644 (file)
@@ -858,14 +858,4 @@ class MysqlUpdater extends DatabaseUpdater {
                $this->applyPatch( 'patch-user-newtalk-timestamp-null.sql' );
                $this->output( "done.\n" );
        }
-
-       protected function doPopulateRevSha1() {
-               if ( $this->updateRowExists( 'populate rev_sha1' ) ) {
-                       $this->output( "...rev_sha1/ar_sha1 columns already populated.\n" );
-                       return;
-               }
-
-               $task = $this->maintenance->runChild( 'PopulateRevisionSha1' );
-               $task->execute();
-       }
 }
index 3b6df6e..f0a1663 100644 (file)
@@ -63,6 +63,9 @@ class SqliteUpdater extends DatabaseUpdater {
                        // 1.19
                        array( 'addTable', 'config',                            'patch-config.sql' ),
                        array( 'addIndex', 'logging',       'type_action',      'patch-logging-type-action-index.sql'),
+                       array( 'addField', 'revision',      'rev_sha1',         'patch-rev_sha1.sql' ),
+                       array( 'addField', 'archive',       'ar_sha1',          'patch-ar_sha1.sql' ),
+                       array( 'doPopulateRevSha1' ),
                );
        }
 
index 7d93f16..3e490d1 100644 (file)
@@ -30,7 +30,7 @@ class PopulateRevisionSha1 extends Maintenance {
        }
 
        public function execute() {
-               $db = wfGetDB( DB_MASTER );
+               $db = $this->getDB( DB_MASTER );
 
                $this->output( "Populating rev_sha1 column\n" );
                $this->doSha1Updates( $db, 'revision', 'rev_id', 'rev' );