mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 15:54:05 +00:00
migrate-fresh: show migration output when verbose (#1464)
Resubmission of #1369 (by @lordofthebrain), changes adapted to v4. Also added a test (passes with the MigrateFresh changes, fails without them). --------- Co-authored-by: lordofthebrain <f.mangelsdorf@gmail.com> Co-authored-by: Samuel Stancl <samuel@archte.ch>
This commit is contained in:
parent
aa9d1d7fcf
commit
df4be2e060
2 changed files with 35 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ use Stancl\Tenancy\Concerns\ParallelCommand;
|
|||
use Stancl\Tenancy\Database\Contracts\TenantWithDatabase;
|
||||
use Stancl\Tenancy\Database\Exceptions\TenantDatabaseDoesNotExistException;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\NullOutput;
|
||||
use Symfony\Component\Console\Output\OutputInterface as OI;
|
||||
|
||||
class MigrateFresh extends BaseCommand
|
||||
|
|
@ -72,11 +73,13 @@ class MigrateFresh extends BaseCommand
|
|||
|
||||
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()],
|
||||
'--step' => $this->option('step'),
|
||||
'--force' => true,
|
||||
]) === 0;
|
||||
], $output) === 0;
|
||||
}
|
||||
|
||||
protected function childHandle(mixed ...$args): bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue