Answer the question
In order to leave comments, you need to log in
How to solve Laravel migration error?
I will write right away that laravel has just started to study.
I create a clean project on Laravel 6. I create a database and register it in .env.
create migration file
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBlogsTable extends Migration
{
public function up()
{
Schema::create('blogs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('title');
$table->text('content');
$table->integer('user_id');
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users');
});
}
public function down()
{
Schema::dropIfExists('blogs');
}
}
Answer the question
In order to leave comments, you need to log in
Is it that it does not work from a version above 5.8?
$table->bigInteger('user_id')->unsigned();
on Laravel 6
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question