samedi 8 juin 2019

Removing unique i a index column

i need to remov from a column the UNIQUE, mas is giving me a error

Thought in maybe if this is the reson droppig index and after dropping index add it again, but not sure if this is the right way.

This is how i did in first migrate: $table->bigInteger('user_id')->unique()->index()->unsigned();

Than this what i tried to do in dropping $table->dropUnique(['user_id']);

It gives e this error:

 Illuminate\Database\QueryException  : SQLSTATE[HY000]: General error: 1553 Cannot drop index 'models_user_id_unique': needed in a foreign key constraint (SQL: alter table `models` drop index `models_user_id_unique`)



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/31itEFF
via IFTTT

Aucun commentaire:

Enregistrer un commentaire