fix(test): make song-sections rollback guard test resilient to new migrations
This commit is contained in:
parent
1df04c70e0
commit
ea4b868650
|
|
@ -45,8 +45,10 @@
|
||||||
$this->expectException(RuntimeException::class);
|
$this->expectException(RuntimeException::class);
|
||||||
$this->expectExceptionMessage('Destruktive Migration');
|
$this->expectExceptionMessage('Destruktive Migration');
|
||||||
|
|
||||||
// The guarded migration (create_song_sections_and_rescope_slides) is 3rd from the top
|
// create_song_sections_and_rescope_slides is a destructive migration whose down()
|
||||||
// of the migration stack (2 newer migrations were added after it).
|
// throws by design. RefreshDatabase applies every migration in a single batch, so a
|
||||||
// Rolling back 3 steps reaches the destructive guard and triggers the RuntimeException.
|
// full-batch rollback proceeds newest -> oldest and reaches the guard before touching
|
||||||
Artisan::call('migrate:rollback', ['--step' => 3]);
|
// anything older. This stays correct no matter how many migrations are added above the
|
||||||
|
// guard later: they simply roll back first, then the guard throws the RuntimeException.
|
||||||
|
Artisan::call('migrate:rollback');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue