Skip to content

Commit

Permalink
Check file is loaded before trying to rollback it
Browse files Browse the repository at this point in the history
  • Loading branch information
dbpolito authored Jul 5, 2017
1 parent c3d9de8 commit 0f08305
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Illuminate/Database/Migrations/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,15 @@ protected function rollbackMigrations(array $migrations, $paths, array $options)
// repository already returns these migration's names in reverse order.
foreach ($migrations as $migration) {
$migration = (object) $migration;

if (! $file = Arr::get($files, $migration->migration)) {
continue;
}

$rolledBack[] = $files[$migration->migration];
$rolledBack[] = $file;

$this->runDown(
$files[$migration->migration],
$file,
$migration, Arr::get($options, 'pretend', false)
);
}
Expand Down

0 comments on commit 0f08305

Please sign in to comment.