From ca982f6f32a30c32b06ecc4962b3dda5efa22b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Kr=C3=A4mer?= Date: Wed, 6 Aug 2014 16:30:36 +0200 Subject: [PATCH] Refs https://github.com/CakeDC/migrations/issues/140 Fixing the dry run output in other places as well --- Lib/CakeMigration.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Lib/CakeMigration.php b/Lib/CakeMigration.php index b55bac22..b1200ce5 100644 --- a/Lib/CakeMigration.php +++ b/Lib/CakeMigration.php @@ -166,6 +166,7 @@ public function getQueryLog() { * Constructor * * @param array $options optional load object properties + * @throws MigrationException */ public function __construct($options = array()) { parent::__construct(); @@ -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); } @@ -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)); @@ -490,9 +490,6 @@ protected function _alterTable($type, $tables) { } $this->_invokeCallbacks('afterAction', $type . '_field', $callbackData); } - if ($this->dry) { - return true; - } } if ($type !== 'drop') { @@ -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))) {