Olá, estou obtendo o seguinte erro ao tentar rodar o comando migrate.
Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table `seasons` add constraint `seasons_serie_id_foreign` foreign key (`serie_id`) references `series` (`id`))
Estas são as funções:
public function up()
{
Schema::create('series', function(Blueprint $table) {
$table->bigIncrements('id');
$table->string('name');
});
}
public function up()
{
Schema::create('seasons', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('number');
$table->bigInteger('serie_id');
$table->foreign('serie_id')
->references('id')
->on('series');
});
}
public function up()
{
Schema::create('episodes', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('number');
$table->bigInteger('season_id');
$table->foreign('season_id')
->references('id')
->on('seasons');
});
}