瀏覽代碼

Merge pull request #740 from visuddhinanda/laravel-migrate-wbw

增加唯一索引
visuddhinanda 4 年之前
父節點
當前提交
64b0d7ac8a
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      database/migrations/2022_02_04_012828_create_shares_table.php

+ 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']);
         });
     }