Index: trunk/phase3/includes/installer/DatabaseUpdater.php |
— | — | @@ -412,10 +412,10 @@ |
413 | 413 | * @param $fullpath Boolean Whether to treat $patch path as a relative or not |
414 | 414 | */ |
415 | 415 | protected function addTable( $name, $patch, $fullpath = false ) { |
416 | | - $this->output( "Creating $name table... " ); |
417 | 416 | 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" ); |
419 | 418 | } else { |
| 419 | + $this->output( "Creating $name table..." ); |
420 | 420 | $this->applyPatch( $patch, $fullpath ); |
421 | 421 | $this->output( "done.\n" ); |
422 | 422 | } |
— | — | @@ -429,12 +429,12 @@ |
430 | 430 | * @param $fullpath Boolean Whether to treat $patch path as a relative or not |
431 | 431 | */ |
432 | 432 | protected function addField( $table, $field, $patch, $fullpath = false ) { |
433 | | - $this->output( "Adding $field field to table $table..." ); |
434 | 433 | if ( !$this->db->tableExists( $table, __METHOD__ ) ) { |
435 | 434 | $this->output( "...$table table does not exist, skipping new field patch.\n" ); |
436 | 435 | } 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" ); |
438 | 437 | } else { |
| 438 | + $this->output( "Adding $field field to table $table..." ); |
439 | 439 | $this->applyPatch( $patch, $fullpath ); |
440 | 440 | $this->output( "done.\n" ); |
441 | 441 | } |
— | — | @@ -448,10 +448,10 @@ |
449 | 449 | * @param $fullpath Boolean Whether to treat $patch path as a relative or not |
450 | 450 | */ |
451 | 451 | protected function addIndex( $table, $index, $patch, $fullpath = false ) { |
452 | | - $this->output( "Adding $index key to table $table..." ); |
453 | 452 | 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" ); |
455 | 454 | } else { |
| 455 | + $this->output( "Adding $index key to table $table... " ); |
456 | 456 | $this->applyPatch( $patch, $fullpath ); |
457 | 457 | $this->output( "done.\n" ); |
458 | 458 | } |
— | — | @@ -466,12 +466,12 @@ |
467 | 467 | * @param $fullpath Boolean Whether to treat $patch path as a relative or not |
468 | 468 | */ |
469 | 469 | protected function dropField( $table, $field, $patch, $fullpath = false ) { |
470 | | - $this->output( "Dropping field $field from table $table..." ); |
471 | 470 | if ( $this->db->fieldExists( $table, $field, __METHOD__ ) ) { |
| 471 | + $this->output( "Table $table contains $field field. Dropping... " ); |
472 | 472 | $this->applyPatch( $patch, $fullpath ); |
473 | 473 | $this->output( "done.\n" ); |
474 | 474 | } 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" ); |
476 | 476 | } |
477 | 477 | } |
478 | 478 | |
— | — | @@ -484,12 +484,12 @@ |
485 | 485 | * @param $fullpath Boolean: Whether to treat $patch path as a relative or not |
486 | 486 | */ |
487 | 487 | protected function dropIndex( $table, $index, $patch, $fullpath = false ) { |
488 | | - $this->output( "Dropping $index key from table $table... " ); |
489 | 488 | if ( $this->db->indexExists( $table, $index, __METHOD__ ) ) { |
| 489 | + $this->output( "Dropping $index key from table $table... " ); |
490 | 490 | $this->applyPatch( $patch, $fullpath ); |
491 | 491 | $this->output( "done.\n" ); |
492 | 492 | } 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" ); |
494 | 494 | } |
495 | 495 | } |
496 | 496 | |
— | — | @@ -499,12 +499,12 @@ |
500 | 500 | * @param $fullpath bool |
501 | 501 | */ |
502 | 502 | protected function dropTable( $table, $patch, $fullpath = false ) { |
503 | | - $this->output( "Dropping table $table... " ); |
504 | 503 | if ( $this->db->tableExists( $table, __METHOD__ ) ) { |
| 504 | + $this->output( "Dropping table $table... " ); |
505 | 505 | $this->applyPatch( $patch, $fullpath ); |
506 | 506 | $this->output( "done.\n" ); |
507 | 507 | } else { |
508 | | - $this->output( "...$table doesn't exist, skipping drop table.\n" ); |
| 508 | + $this->output( "...$table doesn't exist.\n" ); |
509 | 509 | } |
510 | 510 | } |
511 | 511 | |
— | — | @@ -518,7 +518,6 @@ |
519 | 519 | */ |
520 | 520 | public function modifyField( $table, $field, $patch, $fullpath = false ) { |
521 | 521 | $updateKey = "$table-$field-$patch"; |
522 | | - $this->output( "Modifying $field field of table $table... " ); |
523 | 522 | if ( !$this->db->tableExists( $table, __METHOD__ ) ) { |
524 | 523 | $this->output( "...$table table does not exist, skipping modify field patch.\n" ); |
525 | 524 | } elseif ( !$this->db->fieldExists( $table, $field, __METHOD__ ) ) { |
— | — | @@ -526,6 +525,7 @@ |
527 | 526 | } elseif( $this->updateRowExists( $updateKey ) ) { |
528 | 527 | $this->output( "...$field in table $table already modified by patch $patch.\n" ); |
529 | 528 | } else { |
| 529 | + $this->output( "Modifying $field field of table $table..." ); |
530 | 530 | $this->applyPatch( $patch, $fullpath ); |
531 | 531 | $this->insertUpdateRow( $updateKey ); |
532 | 532 | $this->output( "done.\n" ); |