criei as migrations e quando tento rodar o migrate ele me devolve o erro :
"SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table temporadas
add constraint temporadas_serie_id_foreign
foreign key (serie_id
) references series
(id
))"
minhas migrations:
public function up()
{
Schema::create('temporadas', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('numero');
$table->integer('serie_id');
$table->foreign('serie_id')
->references('id')
->on('series');
});
}
public function up()
{
Schema::create('episodios', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('numero');
$table->integer('temporada_id');
$table->foreign('temporada_id')
->references('id')
->on('temporadas');
});
}
public function up()
{
Schema::create('series', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('nome');
});
}