Skip to content

Commit

Permalink
Fix offset migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
pips- committed Mar 19, 2017
1 parent 6f264c3 commit a26509c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/Task/Db/Migrate.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,12 @@ private function migrate_from_offset($steps, $current_version, $direction)
$this->_return .= "\nsteps: " . $steps . " $direction\n";
}

// If we are not at the bottom then adjust our index (to satisfy array_slice)
if ($current_index == -1 && $direction === 'down') {
$available = array();
} else {
if ($direction === 'up') {
$current_index += 1;
} else {
$current_index += $steps;
}
// If we are not at the bottom then adjust our index (to satisfy array_slice)
$current_index += 1;

// check to see if we have enough migrations to run - the user
// might have asked to run more than we have available
$available = array_slice($migrations, $current_index, $steps);
Expand Down

0 comments on commit a26509c

Please sign in to comment.