public function up()
{
Schema::create('company_eligibilities', function (Blueprint $table) {
$table->id();
$table->string('marks');
$table->integer('company_id')->unsigned();
$table->timestamps();
$table->foreign('company_id')
->references('id')->on('companies')
->onDelete('cascade')
->onUpdate('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('company_eligibilities');
}
Company migration already did before executing the above migration
I am getting the above error when I am trying to create a table along with the foreign key. Have I done something wrong ??