r103892 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103891‎ | r103892 | r103893 >
Date:13:28, 22 November 2011
Author:hashar
Status:ok
Tags:
Comment:
revert r103691 that makes update.php output garbage

reopens bug 32020:
- Improve messages output by the database updaters
closes bug 32508:
- Too many update messages even though nothing much happens
Modified paths:
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -412,10 +412,10 @@
413413 * @param $fullpath Boolean Whether to treat $patch path as a relative or not
414414 */
415415 protected function addTable( $name, $patch, $fullpath = false ) {
416 - $this->output( "Creating $name table... " );
417416 if ( $this->db->tableExists( $name, __METHOD__ ) ) {
418 - $this->output( "...$name table already exists. Skipping create table $name\n" );
 417+ $this->output( "...$name table already exists.\n" );
419418 } else {
 419+ $this->output( "Creating $name table..." );
420420 $this->applyPatch( $patch, $fullpath );
421421 $this->output( "done.\n" );
422422 }
@@ -429,12 +429,12 @@
430430 * @param $fullpath Boolean Whether to treat $patch path as a relative or not
431431 */
432432 protected function addField( $table, $field, $patch, $fullpath = false ) {
433 - $this->output( "Adding $field field to table $table..." );
434433 if ( !$this->db->tableExists( $table, __METHOD__ ) ) {
435434 $this->output( "...$table table does not exist, skipping new field patch.\n" );
436435 } elseif ( $this->db->fieldExists( $table, $field, __METHOD__ ) ) {
437 - $this->output( "...already have $field field in $table table, skipping new field patch.\n" );
 436+ $this->output( "...have $field field in $table table.\n" );
438437 } else {
 438+ $this->output( "Adding $field field to table $table..." );
439439 $this->applyPatch( $patch, $fullpath );
440440 $this->output( "done.\n" );
441441 }
@@ -448,10 +448,10 @@
449449 * @param $fullpath Boolean Whether to treat $patch path as a relative or not
450450 */
451451 protected function addIndex( $table, $index, $patch, $fullpath = false ) {
452 - $this->output( "Adding $index key to table $table..." );
453452 if ( $this->db->indexExists( $table, $index, __METHOD__ ) ) {
454 - $this->output( "...$index key already set on $table table, skipping new index patch.\n" );
 453+ $this->output( "...$index key already set on $table table.\n" );
455454 } else {
 455+ $this->output( "Adding $index key to table $table... " );
456456 $this->applyPatch( $patch, $fullpath );
457457 $this->output( "done.\n" );
458458 }
@@ -466,12 +466,12 @@
467467 * @param $fullpath Boolean Whether to treat $patch path as a relative or not
468468 */
469469 protected function dropField( $table, $field, $patch, $fullpath = false ) {
470 - $this->output( "Dropping field $field from table $table..." );
471470 if ( $this->db->fieldExists( $table, $field, __METHOD__ ) ) {
 471+ $this->output( "Table $table contains $field field. Dropping... " );
472472 $this->applyPatch( $patch, $fullpath );
473473 $this->output( "done.\n" );
474474 } else {
475 - $this->output( "...$table table does not contain $field field, skipping drop field.\n" );
 475+ $this->output( "...$table table does not contain $field field.\n" );
476476 }
477477 }
478478
@@ -484,12 +484,12 @@
485485 * @param $fullpath Boolean: Whether to treat $patch path as a relative or not
486486 */
487487 protected function dropIndex( $table, $index, $patch, $fullpath = false ) {
488 - $this->output( "Dropping $index key from table $table... " );
489488 if ( $this->db->indexExists( $table, $index, __METHOD__ ) ) {
 489+ $this->output( "Dropping $index key from table $table... " );
490490 $this->applyPatch( $patch, $fullpath );
491491 $this->output( "done.\n" );
492492 } else {
493 - $this->output( "...$index key doesn't exist in table $table, skipping drop key\n" );
 493+ $this->output( "...$index key doesn't exist.\n" );
494494 }
495495 }
496496
@@ -499,12 +499,12 @@
500500 * @param $fullpath bool
501501 */
502502 protected function dropTable( $table, $patch, $fullpath = false ) {
503 - $this->output( "Dropping table $table... " );
504503 if ( $this->db->tableExists( $table, __METHOD__ ) ) {
 504+ $this->output( "Dropping table $table... " );
505505 $this->applyPatch( $patch, $fullpath );
506506 $this->output( "done.\n" );
507507 } else {
508 - $this->output( "...$table doesn't exist, skipping drop table.\n" );
 508+ $this->output( "...$table doesn't exist.\n" );
509509 }
510510 }
511511
@@ -518,7 +518,6 @@
519519 */
520520 public function modifyField( $table, $field, $patch, $fullpath = false ) {
521521 $updateKey = "$table-$field-$patch";
522 - $this->output( "Modifying $field field of table $table... " );
523522 if ( !$this->db->tableExists( $table, __METHOD__ ) ) {
524523 $this->output( "...$table table does not exist, skipping modify field patch.\n" );
525524 } elseif ( !$this->db->fieldExists( $table, $field, __METHOD__ ) ) {
@@ -526,6 +525,7 @@
527526 } elseif( $this->updateRowExists( $updateKey ) ) {
528527 $this->output( "...$field in table $table already modified by patch $patch.\n" );
529528 } else {
 529+ $this->output( "Modifying $field field of table $table..." );
530530 $this->applyPatch( $patch, $fullpath );
531531 $this->insertUpdateRow( $updateKey );
532532 $this->output( "done.\n" );

Follow-up revisions

RevisionCommit summaryAuthorDate
r103917Partial revert of r103697 for bug 32508reedy16:28, 22 November 2011
r105531(bug 32508) clean up update.php messages...hashar10:04, 8 December 2011
r108716(bug 32508) Fix updater output...hashar10:59, 12 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103691* (bug 32020) Improve messages output by the database updaters...reedy17:18, 19 November 2011

Status & tagging log