@Analka

Не проходит миграция Laravel 6?

Почему не проходит миграция
public function up()
    {
        Schema::create('article_galleries', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('article_id')->index();
            $table->foreign('article_id')
                ->references('id')->on('articles')
                ->onDelete('cascade');
            $table->string('title')->nullable();
            $table->mediumText('description')->nullable();
            $table->string('image')->nullable();
            $table->timestamps();
        });
    }

выдает ошибку
Migrating: 2019_08_06_195958_create_article_galleries_table

Illuminate\Database\QueryException  : SQLSTATE[HY000]: General error: 3780 Referencing column 'articles_id' and referenced column 'id' in foreign key constraint 'article_galleries_articles_id_foreign' are incompatible. (SQL: alter table `article_galleries` add constraint `article_galleries_articles_id_foreign` foreign key (`articles_id`) references `articles` (`id`) on delete cascade)
  • Вопрос задан
  • 244 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы