Answers for "laravel Cannot add foreign key constraint"

PHP
1

Laravel adding Foreign Key Constraints

$table->foreignId('user_id')
      ->constrained("users") <- // You don't need to specify table if it matched laravel naming conventions.
      ->onUpdate('cascade')
      ->onDelete('cascade');
Posted by: Guest on June-16-2021
0

laravel Cannot add foreign key constraint

$table->bigInteger('user_id')->unsigned();
Posted by: Guest on January-05-2022

Code answers related to "laravel Cannot add foreign key constraint"

Browse Popular Code Answers by Language