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..85bd98bdba4 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 @@ -14,6 +14,10 @@ class RemoveViewedAtFromContacts extends Migration public function up() { Schema::table('contacts', function (Blueprint $table) { + if (!$table->hasColumn('viewed_at')) { + return; + } + $table->dropColumn( 'viewed_at' ); @@ -28,6 +32,10 @@ public function up() public function down() { Schema::table('contacts', function (Blueprint $table) { + if ($table->hasColumn('viewed_at')) { + return; + } + $table->dateTime('viewed_at')->nullable(); }); }