Skip to content
Advertisement

Laravel :: Best way to update a foreign key

I have this migration file

JavaScript

and I want to update to make it ->onDelete(‘cascade’);

JavaScript

What is the best way to do this?

Is there something like ->change();

Thanks

Advertisement

Answer

Drop the foreign key then add it again and run migrate.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement