Browse Source

Add unique index to likes migration

Daniel Supernault 7 năm trước cách đây
mục cha
commit
594576185b

+ 1 - 0
database/migrations/2018_04_17_012812_create_likes_table.php

@@ -19,6 +19,7 @@ class CreateLikesTable extends Migration
             $table->bigInteger('status_id')->unsigned();
             $table->bigInteger('status_id')->unsigned();
             // Flag to remove spammy profile_ids
             // Flag to remove spammy profile_ids
             $table->boolean('flagged')->default(false);
             $table->boolean('flagged')->default(false);
+            $table->unique(['profile_id', 'status_id']);
             $table->timestamps();
             $table->timestamps();
         });
         });
     }
     }