https://laravel.com/docs/5.2/migrations#modifying-columns
Can't explain it better. Create a new migration file. Add your code to change the column attributes and run migrate command. It will only run new migrations.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi guys got a question about migrations, I need to remove a unique constrain from a table without refresh the db. how could i do that ?
$table->integer('user_id')->unsigned()->index()->unique();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
How can i update the user_id row to remove the unique constrain using migrations.
Thanks guys for any help you can give me, must appreciated.
https://laravel.com/docs/5.2/migrations#modifying-columns
Can't explain it better. Create a new migration file. Add your code to change the column attributes and run migrate command. It will only run new migrations.
Please or to participate in this conversation.