mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 16:54:05 +00:00
Set TenantDump's path to configured schema-path if the path doesn't get passed
This commit is contained in:
parent
0a3e4f9273
commit
6327b5b417
1 changed files with 7 additions and 3 deletions
|
|
@ -4,11 +4,11 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Stancl\Tenancy\Commands;
|
namespace Stancl\Tenancy\Commands;
|
||||||
|
|
||||||
use Illuminate\Contracts\Events\Dispatcher;
|
|
||||||
use Illuminate\Database\ConnectionResolverInterface;
|
|
||||||
use Illuminate\Database\Console\DumpCommand;
|
|
||||||
use Stancl\Tenancy\Contracts\Tenant;
|
use Stancl\Tenancy\Contracts\Tenant;
|
||||||
|
use Illuminate\Contracts\Events\Dispatcher;
|
||||||
|
use Illuminate\Database\Console\DumpCommand;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
|
use Illuminate\Database\ConnectionResolverInterface;
|
||||||
|
|
||||||
class TenantDump extends DumpCommand
|
class TenantDump extends DumpCommand
|
||||||
{
|
{
|
||||||
|
|
@ -22,6 +22,10 @@ class TenantDump extends DumpCommand
|
||||||
|
|
||||||
public function handle(ConnectionResolverInterface $connections, Dispatcher $dispatcher): int
|
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->option('tenant')
|
||||||
?? tenant()
|
?? tenant()
|
||||||
?? $this->ask('What tenant do you want to dump the schema for?')
|
?? $this->ask('What tenant do you want to dump the schema for?')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue