Skip to content

Commit

Permalink
Merge pull request #181 from burzum/bug/gh-140
Browse files Browse the repository at this point in the history
Fixing #140 Migration run dry...
  • Loading branch information
Florian Krämer committed Aug 5, 2014
2 parents 497ec9d + d6cc1fa commit b13995d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Lib/CakeMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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':
Expand Down Expand Up @@ -480,7 +481,7 @@ protected function _alterTable($type, $tables) {

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

$this->_invokeCallbacks('beforeAction', $type . '_field', $callbackData);
Expand All @@ -489,6 +490,9 @@ protected function _alterTable($type, $tables) {
}
$this->_invokeCallbacks('afterAction', $type . '_field', $callbackData);
}
if ($this->dry) {
return true;
}
}

if ($type !== 'drop') {
Expand Down

0 comments on commit b13995d

Please sign in to comment.