Skip to content

Commit 83f4410

Browse files
[6.x] migrate --seed should seed the same database (#31678)
* migrate --seed should seed the same database * Update MigrateCommand.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent 283bb24 commit 83f4410

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Illuminate/Database/Console/Migrations/MigrateCommand.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ public function handle()
7575
// seed task to re-populate the database, which is convenient when adding
7676
// a migration and a seed at the same time, as it is only this command.
7777
if ($this->option('seed') && ! $this->option('pretend')) {
78-
$this->call('db:seed', ['--force' => true]);
78+
$this->call('db:seed', array_filter([
79+
'--database' => $this->option('database'),
80+
'--force' => true,
81+
]));
7982
}
8083
}
8184

0 commit comments

Comments
 (0)