Skip to content

Commit 2328c7a

Browse files
authored
[5.4] Show output with migration name before starting a migration or rollback
Laravel shows the migration name when an UP or DOWN has finished, but not before it starts. It would be useful to see the migration name before it starts, in the runUp and runDown methods. I spent some time today trying to figure out why my simple migration was just hanging -- rebooting my VM and such, when it was actually a 10+ minute long migration a teammate had slipped in that was running before mine. Since there is no output until finished, I thought something was hanging. It would have been useful to know that it was busy running THAT migration. For language, I’d propose this: ```$this->note("<info>Rolling back:</info> {$file}"); $this->note("<info>Migrating:</info> {$file}");``` (to matched the ‘Rolled Back: ‘ and ‘Migrated: ' messages on completion.)
1 parent 2574c76 commit 2328c7a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Illuminate/Database/Migrations/Migrator.php

+4
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ protected function runUp($file, $batch, $pretend)
171171
if ($pretend) {
172172
return $this->pretendToRun($migration, 'up');
173173
}
174+
175+
$this->note("<info>Migrating:</info> {$file}");
174176

175177
$this->runMigration($migration, 'up');
176178

@@ -316,6 +318,8 @@ protected function runDown($file, $migration, $pretend)
316318
$instance = $this->resolve(
317319
$name = $this->getMigrationName($file)
318320
);
321+
322+
$this->note("<info>Rolling back:</info> {$file}");
319323

320324
if ($pretend) {
321325
return $this->pretendToRun($instance, 'down');

0 commit comments

Comments
 (0)