Skip to content

Commit af25c2c

Browse files
author
FreedomKnight
committed
check table is exists
1 parent fa5c061 commit af25c2c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

database/migrations/0000_00_00_000000_update_taggable_table.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ public function down()
3232
{
3333
$connection = config('taggable.connection');
3434

35-
Schema::connection($connection)->table('taggable_tags', function (Blueprint $table) {
36-
$table->dropForeign('taggable_tags_parent_id_foreign');
37-
});
35+
if (Schema::connection($connection)->hasTable('taggable_tags')) {
36+
Schema::connection($connection)->table('taggable_tags', function (Blueprint $table) {
37+
$table->dropForeign('taggable_tags_parent_id_foreign');
38+
});
39+
}
3840
}
3941
}

0 commit comments

Comments
 (0)