0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Laravel(多対多)】php artisan migrateエラー(SQLSTATE[HY000]: General error: 3780 Referencing column~are incompatible.)

Last updated at Posted at 2020-12-17

Laravelでphp artisan migrateを実行し、SQLSTATE[HY000]: General error: 3780 Referencing column~are incompatibleといったエラーが出てきた場合、設定しているカラムタイプが異なることが原因である場合があります。
「are incompatible」は直訳すると互換性がないと言われています。

.php

//符号なしBIGINTを使用した自動増分ID(主キー)
$table->bigIncrements('id');

//BIGINTカラム
$table->bigInteger('votes');

今一度、自分で設定したカラムタイプの整合性が取れているか確認してみてください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?