Answers for "migration unique laravel"

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
0

unique laravel migration

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

Schema::table('users', function (Blueprint $table) {
    $table->string('email')->unique();
});
Posted by: Guest on September-02-2021
0

laravel migration index

$table->index(['account_id', 'created_at']);
Posted by: Guest on May-08-2020
3

laravel migration integer

$table->bigInteger('votes');
Posted by: Guest on May-22-2020

Code answers related to "migration unique laravel"

Browse Popular Code Answers by Language