From 594576185b21a2b51ecd5803d4e074483a3f06b1 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 29 Apr 2018 10:29:01 -0600 Subject: [PATCH] Add unique index to likes migration --- database/migrations/2018_04_17_012812_create_likes_table.php | 1 + 1 file changed, 1 insertion(+) diff --git a/database/migrations/2018_04_17_012812_create_likes_table.php b/database/migrations/2018_04_17_012812_create_likes_table.php index 8c9d6492..ed20b960 100644 --- a/database/migrations/2018_04_17_012812_create_likes_table.php +++ b/database/migrations/2018_04_17_012812_create_likes_table.php @@ -19,6 +19,7 @@ class CreateLikesTable extends Migration $table->bigInteger('status_id')->unsigned(); // Flag to remove spammy profile_ids $table->boolean('flagged')->default(false); + $table->unique(['profile_id', 'status_id']); $table->timestamps(); }); }