php - How to write a migrate to undo the unique constraint in Laravel? -
i make email field unique
in table.
$table->unique('email');
i've tried
public function up() { schema::table('contacts', function(blueprint $table) { $table->dropunique('email'); }); }
then, when run php artisan migrate, got
it tell me it's not there, i'm 100% sure it's there.
how write migration undo ?
you have $table->dropunique('users_email_unique');
to drop index must specify index's name. laravel assigns reasonable name indexes default. concatenate table name, names of column in index, , index type.
Comments
Post a Comment