Skip to content

Commit 04aa95a

Browse files
committed
Throw warning when a class doesn't exist while doing a rollback
1 parent 61cbc65 commit 04aa95a

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

app/system/Bakery/Migrator.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -244,17 +244,15 @@ public function runDown($step = 1, $sprinkle = "", $pretend = false)
244244
$this->io->note("Rolling back in pretend mode");
245245
}
246246

247-
// Only thing we have to check here before going further is if those migration class are available
248-
// We do it before running anything down to be sure not to break anything
247+
// Loop again to run down each migration
249248
foreach ($migrations as $migration) {
249+
250+
// Check if those migration class are available
250251
if (!class_exists($migration->migration)) {
251-
$this->io->error("Migration class {$migration->migration} doesn't exist.");
252-
exit(1);
252+
$this->io->warning("Migration class {$migration->migration} doesn't exist.");
253+
continue;
253254
}
254-
}
255255

256-
// Loop again to run down each migration
257-
foreach ($migrations as $migration) {
258256
$this->io->write("> <info>Rolling back {$migration->migration}...</info>");
259257
$migrationClass = $migration->migration;
260258
$instance = new $migrationClass($this->schema, $this->io);

0 commit comments

Comments
 (0)