Пытаюсь присвоить foreign key но при выполнении migrate, получаю вот такую ошибку, не пойму в чем проблема.
Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table `socialites` add constraint `socialites_user_id_foreign` foreig
n key (`user_id`) references `users` (`id`) on delete CASCADE)
General error: 1215 Cannot add foreign key constraint
public function up()
{
Schema::create('socialites', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('user_id')->index();
$table->string('provider_user_id');
$table->string('provider');
$table->timestamps();
});
Schema::table('socialites', function (Blueprint $table) {
$table->foreign('user_id')
->references('id')
->on('users')
->onDelete('CASCADE');
});
}