Skip to content

Commit

Permalink
check table is exists
Browse files Browse the repository at this point in the history
  • Loading branch information
FreedomKnight committed Mar 5, 2018
1 parent fa5c061 commit af25c2c
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
}
}
}

0 comments on commit af25c2c

Please sign in to comment.