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

Add QueryException to the Migrat command try/catch

This commit is contained in:
lukinovec 2022-10-05 13:08:31 +02:00
parent 53ef136238
commit 8123728181

View file

@ -7,6 +7,7 @@ namespace Stancl\Tenancy\Commands;
use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Console\Migrations\MigrateCommand; use Illuminate\Database\Console\Migrations\MigrateCommand;
use Illuminate\Database\Migrations\Migrator; use Illuminate\Database\Migrations\Migrator;
use Illuminate\Database\QueryException;
use Stancl\Tenancy\Concerns\DealsWithMigrations; use Stancl\Tenancy\Concerns\DealsWithMigrations;
use Stancl\Tenancy\Concerns\ExtendsLaravelCommand; use Stancl\Tenancy\Concerns\ExtendsLaravelCommand;
use Stancl\Tenancy\Concerns\HasATenantsOption; use Stancl\Tenancy\Concerns\HasATenantsOption;
@ -59,7 +60,7 @@ class Migrate extends MigrateCommand
event(new DatabaseMigrated($tenant)); event(new DatabaseMigrated($tenant));
}); });
} catch (TenantDatabaseDoesNotExistException $th) { } catch (TenantDatabaseDoesNotExistException|QueryException $th) {
if (! $this->option('skip-failing')) { if (! $this->option('skip-failing')) {
throw $th; throw $th;
} }