LoginSignup
0
0

More than 3 years have passed since last update.

laravelでseedを使っていてIntegrity constraint violation:1452エラーが表示された時

Last updated at Posted at 2020-03-26

表題の件、今日だけで2回つまづいたので自分のためにも残しておきます!
laravelのseedを使っていて下記のエラーが出てしまった時は、外部キー元のテーブルに当該キーのデータがあるか確認しておきましょう。
無いとエラーになります。
灯台下暗しでした汗

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails 
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