1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-06-20 22:54:05 +00:00

migrate-fresh can show output with verbose

Don't run tenants:migrate silently by default during migrate-fresh; its
output is shown when the command is run with -v/--verbose.

---------

Co-authored-by: lordofthebrain <f.mangelsdorf@gmail.com>
This commit is contained in:
lukinovec 2026-06-13 07:59:50 +02:00
parent 652bc987ce
commit af1231f025

View file

@ -14,6 +14,7 @@ use Stancl\Tenancy\Concerns\ParallelCommand;
use Stancl\Tenancy\Database\Contracts\TenantWithDatabase; use Stancl\Tenancy\Database\Contracts\TenantWithDatabase;
use Stancl\Tenancy\Database\Exceptions\TenantDatabaseDoesNotExistException; use Stancl\Tenancy\Database\Exceptions\TenantDatabaseDoesNotExistException;
use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Output\OutputInterface as OI; use Symfony\Component\Console\Output\OutputInterface as OI;
class MigrateFresh extends BaseCommand class MigrateFresh extends BaseCommand
@ -72,11 +73,13 @@ class MigrateFresh extends BaseCommand
protected function migrateTenant(TenantWithDatabase $tenant): bool protected function migrateTenant(TenantWithDatabase $tenant): bool
{ {
return $this->callSilently('tenants:migrate', [ $output = $this->getOutput()->isVerbose() ? $this->output : new NullOutput;
return $this->runCommand('tenants:migrate', [
'--tenants' => [$tenant->getTenantKey()], '--tenants' => [$tenant->getTenantKey()],
'--step' => $this->option('step'), '--step' => $this->option('step'),
'--force' => true, '--force' => true,
]) === 0; ], $output) === 0;
} }
protected function childHandle(mixed ...$args): bool protected function childHandle(mixed ...$args): bool