Answers for "on delete cascade laravel migration"

PHP
3

cascade in laravel migration

$table->dropForeign('answers_user_id_foreign');
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
Posted by: Guest on December-18-2020
0

delete a migration laravel

// delete a migration safely from laravel 
delete migration from database/migrations/ directory
and also delete entry from migrations table
Posted by: Guest on October-29-2020
0

how set cascade on delete and update in same time in laravel

$table->foreign('user_id')->references('id')->on('users')
->onDelete('SET NULL')
->onUpdate('SET NULL'); // also available CASCADE, RESTRICT, DO NOTHING, NO ACTION
Posted by: Guest on July-22-2021

Code answers related to "on delete cascade laravel migration"

Browse Popular Code Answers by Language