diff --git a/database/migrations/2017_01_28_222114_remove_viewed_at_from_contacts.php b/database/migrations/2017_01_28_222114_remove_viewed_at_from_contacts.php index c572a5a67e8..e8c0971d52f 100644 --- a/database/migrations/2017_01_28_222114_remove_viewed_at_from_contacts.php +++ b/database/migrations/2017_01_28_222114_remove_viewed_at_from_contacts.php @@ -13,11 +13,11 @@ class RemoveViewedAtFromContacts extends Migration */ public function up() { - Schema::table('contacts', function (Blueprint $table) { - $table->dropColumn( - 'viewed_at' - ); - }); + if (Schema::hasColumn('contacts', 'viewed_at')) { + Schema::table('contacts', function (Blueprint $table) { + $table->dropColumn('viewed_at'); + }); + } } /** @@ -27,8 +27,10 @@ public function up() */ public function down() { - Schema::table('contacts', function (Blueprint $table) { - $table->dateTime('viewed_at')->nullable(); - }); + if (! Schema::hasColumn('contacts', 'viewed_at')) { + Schema::table('contacts', function (Blueprint $table) { + $table->dateTime('viewed_at')->nullable(); + }); + } } }