Explorar el Código

增加唯一索引

visuddhinanda@gmail.com hace 4 años
padre
commit
1d7de0286d
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  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']);
         });
     }