dimanche 26 juin 2016

Trying to set custom constraint name for default key in Schema Builder: Laravel 5.2

In schema builder we can use the below code to define our own name for the constraint. Below code is for Unique key

$table->unique('Column Name', 'Constraint Name');

Can I do something similar for the default key?

I tried below and did not work

$table->default('Column Name', 'Constraint Name');

I know we can write the below code to define the default constraint but that will not give custom constraint name

$table->boolean('IsPredefined')->default(false);



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire