table-filename persists between calls and causes file to be overwritten #223
Closed
Description
Describe the bug
Hello!
I have a couple of different connections that I'm trying to dump one after the other:
$connections = collect(config('database.connections'))
->mapWithKeys(fn ($item, $key) => [$key => $item['database']])
->each(function ($database, $connection): void {
$task = "Creating migration for database [{$database}] on connection [{$connection}]";
$filename = "create_{$connection}_tables.php";
$this->components->info($task);
$this->call('migrate:generate', [
'--connection' => $connection,
'--path' => $this->path,
'--table-filename' => $filename,
'--skip-log' => true,
'--skip-proc' => true,
'--skip-views' => true,
'--squash' => true,
]);
});
However, each call to migrate:generate
is overwriting the file for the first connection instead of creating a new file with the new connection name. If I generate them all individually then every thing works fine, but it seems like there's something that's not getting flushed after every call.
Expected behavior
I expect there to be a file for every connection.
Details (please complete the following information):
- DB: Postgres
- DB Version: 14.x
- Laravel Version: 10.58.x
- PHP Version: 8.2
- Migrations Generator Version: 7.0.3
Thanks!
Metadata
Assignees
Labels
No labels