Answers for "foreign key migration error laravle"

PHP
17

laravel migation error

use IlluminateSupportFacadesSchema;

public function boot()
{
    Schema::defaultStringLength(191);
}
Posted by: Guest on April-29-2020
0

add foreign key column laravel 5.8

update your `integer('user_id')` to `bigInteger('user_id')`
public function up() { 
        Schema::create('evaluation', function (Blueprint $table) { 
            $table->increments('id'); 
            $table->bigInteger('user_id')->unsigned()->index(); 
            $table->timestamps();
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
        });
    }
Posted by: Guest on October-28-2021

Code answers related to "foreign key migration error laravle"

Browse Popular Code Answers by Language