Browse Source

增加唯一索引

visuddhinanda@gmail.com 4 năm trước cách đây
mục cha
commit
1d7de0286d

+ 2 - 0
database/migrations/2022_02_04_012828_create_shares_table.php

@@ -30,6 +30,8 @@ class CreateSharesTable extends Migration
 
 			$table->timestamp('created_at')->useCurrent()->index();
 			$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate()->index();
+
+            $table->unique(['res_id','res_type','cooperator_id','cooperator_type']);
         });
     }