Skip to content

Commit 5ae3b49

Browse files
authored
Merge pull request #11 from bsbip/master
Check if synchronizations table exists
2 parents 21cbf35 + 8652e83 commit 5ae3b49

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Listeners/MigrationStartedEventListener.php

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace LaravelSynchronize\Listeners;
44

5+
use Schema;
56
use SplFileInfo;
67
use Illuminate\Support\Facades\DB;
78
use Illuminate\Support\Facades\Config;
@@ -41,6 +42,10 @@ public function handle(MigrationStarted $migrationStarted)
4142
return;
4243
}
4344

45+
if (!Schema::hasTable(Config::get('synchronizer.table'))) {
46+
return;
47+
}
48+
4449
$class = get_class($migrationStarted->migration) . 'Synchronization';
4550
$files = $this->synchronizer->getSynchronizations();
4651

0 commit comments

Comments
 (0)