Skip to content

Commit

Permalink
Refs #140 Fixing the dry run output in other places as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Krämer committed Aug 6, 2014
1 parent b13995d commit ca982f6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Lib/CakeMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public function getQueryLog() {
* Constructor
*
* @param array $options optional load object properties
* @throws MigrationException
*/
public function __construct($options = array()) {
parent::__construct();
Expand Down Expand Up @@ -313,7 +314,6 @@ protected function _run() {
*/
protected function migration_order($a, $b) {
$order = array('drop_table', 'rename_table', 'create_table', 'drop_field', 'rename_field', 'alter_field', 'create_field');

return array_search($a, $order) - array_search($b, $order);
}

Expand Down Expand Up @@ -393,7 +393,7 @@ protected function _renameTable($type, $tables) {

if ($this->dry) {
$this->logQuery($sql);
return true;
continue;
}

$this->_invokeCallbacks('beforeAction', 'rename_table', array('old_name' => $oldName, 'new_name' => $newName));
Expand Down Expand Up @@ -490,9 +490,6 @@ protected function _alterTable($type, $tables) {
}
$this->_invokeCallbacks('afterAction', $type . '_field', $callbackData);
}
if ($this->dry) {
return true;
}
}

if ($type !== 'drop') {
Expand Down Expand Up @@ -523,7 +520,7 @@ protected function _alterIndexes($indexes, $type, $table) {

if ($this->dry) {
$this->logQuery($sql);
return true;
continue;
}

if ($this->_invokePrecheck('beforeAction', $type . '_index', array('table' => $table, 'index' => $key))) {
Expand Down

0 comments on commit ca982f6

Please sign in to comment.