Answers for "laravel unique migration with name"

PHP
1

laravel migration remove unique

//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');
Posted by: Guest on September-14-2021
1

laravel migration alter column unique

$table->dropUnique('users_email_unique');
Posted by: Guest on August-31-2021

Code answers related to "laravel unique migration with name"

Browse Popular Code Answers by Language