Answers for "laravel cannot drop foreign key"

PHP
3

laravel remove foreign key

$table->dropForeign('posts_user_id_foreign');
Posted by: Guest on April-22-2020
0

cannot add foreign key constraint laravel

Add it in two steps, and its good to make it unsigned too:
public function up()
{
    Schema::create('priorities', function($table) {
        $table->increments('id', true);
        $table->integer('user_id')->unsigned();
        $table->foreign('user_id')->references('id')->on('users');
        $table->string('priority_name');
        $table->smallInteger('rank');
        $table->text('class');
        $table->timestamps('timecreated');
    });
}

if still same error try removing unsigned() from the above code
Posted by: Guest on March-23-2021

Code answers related to "laravel cannot drop foreign key"

Browse Popular Code Answers by Language