From af25c2cb52603559827f42ee4349e16b732eb18c Mon Sep 17 00:00:00 2001 From: FreedomKnight Date: Mon, 5 Mar 2018 11:33:14 +0800 Subject: [PATCH] check table is exists --- .../0000_00_00_000000_update_taggable_table.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/database/migrations/0000_00_00_000000_update_taggable_table.php b/database/migrations/0000_00_00_000000_update_taggable_table.php index cc9b51e..28568c5 100644 --- a/database/migrations/0000_00_00_000000_update_taggable_table.php +++ b/database/migrations/0000_00_00_000000_update_taggable_table.php @@ -32,8 +32,10 @@ public function down() { $connection = config('taggable.connection'); - Schema::connection($connection)->table('taggable_tags', function (Blueprint $table) { - $table->dropForeign('taggable_tags_parent_id_foreign'); - }); + if (Schema::connection($connection)->hasTable('taggable_tags')) { + Schema::connection($connection)->table('taggable_tags', function (Blueprint $table) { + $table->dropForeign('taggable_tags_parent_id_foreign'); + }); + } } }