From 8123728181b7864981f7a3531f2cdb764cd3bac1 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Wed, 5 Oct 2022 13:08:31 +0200 Subject: [PATCH] Add QueryException to the Migrat command try/catch --- src/Commands/Migrate.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Commands/Migrate.php b/src/Commands/Migrate.php index 4062f6ef..995d28e0 100644 --- a/src/Commands/Migrate.php +++ b/src/Commands/Migrate.php @@ -7,6 +7,7 @@ namespace Stancl\Tenancy\Commands; use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Database\Console\Migrations\MigrateCommand; use Illuminate\Database\Migrations\Migrator; +use Illuminate\Database\QueryException; use Stancl\Tenancy\Concerns\DealsWithMigrations; use Stancl\Tenancy\Concerns\ExtendsLaravelCommand; use Stancl\Tenancy\Concerns\HasATenantsOption; @@ -59,7 +60,7 @@ class Migrate extends MigrateCommand event(new DatabaseMigrated($tenant)); }); - } catch (TenantDatabaseDoesNotExistException $th) { + } catch (TenantDatabaseDoesNotExistException|QueryException $th) { if (! $this->option('skip-failing')) { throw $th; }