diff --git a/Lib/CakeMigration.php b/Lib/CakeMigration.php index 3a5acade..b55bac22 100644 --- a/Lib/CakeMigration.php +++ b/Lib/CakeMigration.php @@ -431,7 +431,7 @@ protected function _alterTable($type, $tables) { $tableFields = $this->db->describe($model); $tableFields['indexes'] = $this->db->index($model); $tableFields['tableParameters'] = $this->db->readTableParameters($this->db->fullTableName($model, false, false)); - + if ($type === 'drop') { $field = $col; } @@ -442,6 +442,7 @@ protected function _alterTable($type, $tables) { $data = array('table' => $table, 'field' => $field); } $callbackData = $data; + if ($this->_invokePrecheck('beforeAction', $type . '_field', $data)) { switch ($type) { case 'add': @@ -480,7 +481,7 @@ protected function _alterTable($type, $tables) { if ($this->dry) { $this->logQuery($sql); - return true; + continue; } $this->_invokeCallbacks('beforeAction', $type . '_field', $callbackData); @@ -489,6 +490,9 @@ protected function _alterTable($type, $tables) { } $this->_invokeCallbacks('afterAction', $type . '_field', $callbackData); } + if ($this->dry) { + return true; + } } if ($type !== 'drop') {