소스 검색

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