Skip to content

Commit

Permalink
[5.4] Show output with migration name before starting a migration or …
Browse files Browse the repository at this point in the history
…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.)
  • Loading branch information
mmccaff authored Mar 16, 2017
1 parent 2574c76 commit 2328c7a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Illuminate/Database/Migrations/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ protected function runUp($file, $batch, $pretend)
if ($pretend) {
return $this->pretendToRun($migration, 'up');
}

$this->note("<info>Migrating:</info> {$file}");

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

Expand Down Expand Up @@ -316,6 +318,8 @@ protected function runDown($file, $migration, $pretend)
$instance = $this->resolve(
$name = $this->getMigrationName($file)
);

$this->note("<info>Rolling back:</info> {$file}");

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

0 comments on commit 2328c7a

Please sign in to comment.