r103031 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103030‎ | r103031 | r103032 >
Date:21:14, 14 November 2011
Author:reedy
Status:ok
Tags:
Comment:
Reverts r102799, followsup r102800 also

Logged LoggedUpdateMaintenance did the inserting, the problem was the script was unconditionally run


Added some documentation tooo
Modified paths:
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/MysqlUpdater.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -191,7 +191,7 @@
192192 public function addExtensionField( $tableName, $columnName, $sqlPath ) {
193193 $this->extensionUpdates[] = array( 'addField', $tableName, $columnName, $sqlPath, true );
194194 }
195 -
 195+
196196 /**
197197 * Add a maintenance script to be run after the database updates are complete
198198 * @param $class string Name of a Maintenance subclass
@@ -558,6 +558,9 @@
559559
560560 # Common updater functions
561561
 562+ /**
 563+ * Sets the number of active users in the site_stats table
 564+ */
562565 protected function doActiveUsersInit() {
563566 $activeUsers = $this->db->selectField( 'site_stats', 'ss_active_users', false, __METHOD__ );
564567 if ( $activeUsers == -1 ) {
@@ -573,6 +576,9 @@
574577 $this->output( "...ss_active_users user count set...\n" );
575578 }
576579
 580+ /**
 581+ * Populates the log_user_text field in the logging table
 582+ */
577583 protected function doLogUsertextPopulation() {
578584 if ( !$this->updateRowExists( 'populate log_usertext' ) ) {
579585 $this->output(
@@ -582,10 +588,12 @@
583589
584590 $task = $this->maintenance->runChild( 'PopulateLogUsertext' );
585591 $task->execute();
586 - $this->insertUpdateRow( 'populate log_usertext' );
587592 }
588593 }
589594
 595+ /**
 596+ * Migrate log params to new table and index for searching
 597+ */
590598 protected function doLogSearchPopulation() {
591599 if ( !$this->updateRowExists( 'populate log_search' ) ) {
592600 $this->output(
@@ -595,10 +603,12 @@
596604
597605 $task = $this->maintenance->runChild( 'PopulateLogSearch' );
598606 $task->execute();
599 - $this->insertUpdateRow( 'populate log_search' );
600607 }
601608 }
602609
 610+ /**
 611+ * Updates the timestamps in the transcache table
 612+ */
603613 protected function doUpdateTranscacheField() {
604614 if ( $this->updateRowExists( 'convert transcache field' ) ) {
605615 $this->output( "...transcache tc_time already converted.\n" );
@@ -610,6 +620,9 @@
611621 $this->output( "ok\n" );
612622 }
613623
 624+ /**
 625+ * Update CategoryLinks collation
 626+ */
614627 protected function doCollationUpdate() {
615628 global $wgCategoryCollation;
616629 if ( $this->db->selectField(
@@ -626,6 +639,9 @@
627640 $task->execute();
628641 }
629642
 643+ /**
 644+ * Migrates user options from the user table blob to user_properties
 645+ */
630646 protected function doMigrateUserOptions() {
631647 $cl = $this->maintenance->runChild( 'ConvertUserOptions', 'convertUserOptions.php' );
632648 $this->output( "Migrating remaining user_options... " );
@@ -633,6 +649,9 @@
634650 $this->output( "done.\n" );
635651 }
636652
 653+ /**
 654+ * Rebuilds the localisation cache
 655+ */
637656 protected function doRebuildLocalisationCache() {
638657 /**
639658 * @var $cl RebuildLocalisationCache
Index: trunk/phase3/includes/installer/MysqlUpdater.php
@@ -758,7 +758,6 @@
759759
760760 $task = $this->maintenance->runChild( 'PopulateParentId' );
761761 $task->execute();
762 - $this->insertUpdateRow( 'populate rev_parent_id' );
763762 }
764763 }
765764

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102799Naff all point varying on $this->updateRowExists when we never bloody insert ...reedy16:47, 11 November 2011
r102800Followup r102799, unconditionally running them anyway also isn't much usereedy16:58, 11 November 2011

Status & tagging log