1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 18:34:04 +00:00

Set TenantDump's path to configured schema-path if the path doesn't get passed

This commit is contained in:
lukinovec 2022-10-25 17:32:43 +02:00
parent 0a3e4f9273
commit 6327b5b417

View file

@ -4,11 +4,11 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Commands;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\ConnectionResolverInterface;
use Illuminate\Database\Console\DumpCommand;
use Stancl\Tenancy\Contracts\Tenant;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Console\DumpCommand;
use Symfony\Component\Console\Input\InputOption;
use Illuminate\Database\ConnectionResolverInterface;
class TenantDump extends DumpCommand
{
@ -22,6 +22,10 @@ class TenantDump extends DumpCommand
public function handle(ConnectionResolverInterface $connections, Dispatcher $dispatcher): int
{
if (is_null($this->option('path'))) {
$this->input->setOption('path', config('tenancy.migration_parameters.--schema-path'));
}
$tenant = $this->option('tenant')
?? tenant()
?? $this->ask('What tenant do you want to dump the schema for?')