Проблема миграции в Laravel. Ошибка 3780

При попытке миграции возникает ошибка

General error: 3780 Referencing column 'id_user' and referenced column 'id' in foreign key constraint 'userlist_id_user_foreign' are incompatibl e. (SQL: alter table userlist add constraint userlist_id_user_foreign foreign key (id_user) references users (id))

public function up()
    {
        Schema::create('list_films', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->text('img');
            $table->text('description');
            $table->integer('year');
            $table->string('country');
            $table->string('type');
            $table->timestamps();
        });
    }
public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('login');
            $table->string('password');
            $table->string('img');
            $table->timestamps();
        });
    }
public function up()
    {
        Schema::create('userlist', function (Blueprint $table) {
            $table->bigInteger('id_user');
            $table->bigInteger('id_list');
            $table->primary(['id_user', 'id_list']);
            $table->foreign('id_user')->references('id')->on('users');
            $table->foreign('id_list')->references('id')->on('list_films');
            $table->timestamps();
        });
    }

Изначально типы данных у меня действительно не совпадали, но поменяв id_user и id_list на bigInteger ошибка не исчезла. Что я делаю не так?


Ответы (0 шт):