From 31e30767b44c849a58ec22bd7a467ce0191de54a Mon Sep 17 00:00:00 2001 From: lukinovec Date: Tue, 20 Sep 2022 16:06:15 +0200 Subject: [PATCH] Move migration event dispatching inside try block --- src/Commands/Migrate.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Commands/Migrate.php b/src/Commands/Migrate.php index c0fc4997..bbce9d86 100644 --- a/src/Commands/Migrate.php +++ b/src/Commands/Migrate.php @@ -52,18 +52,17 @@ class Migrate extends MigrateCommand tenancy()->runForMultiple($this->option('tenants'), function ($tenant) { $this->line("Tenant: {$tenant->getTenantKey()}"); - event(new MigratingDatabase($tenant)); - try { + event(new MigratingDatabase($tenant)); // Migrate parent::handle(); + + event(new DatabaseMigrated($tenant)); } catch (Exception $th) { if (! $this->option('skip-failing')) { throw $th; } } - - event(new DatabaseMigrated($tenant)); }); } }