📜  laravel 迁移移除唯一约束 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:37.706000             🧑  作者: Mango

代码示例2
//The UNique need be a constraint name
// This name has this format:
// [TABLE_NAME]_[COLUMN_NAME]_unique
// For 'users' table and 'user_code' column, whe get the name:
// users_user_code_unique
$table->dropUnique('users_user_code_unique');

//The inverst is 
$table->unique('user_code');