Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #646
    dan
    Participant

    SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (website.comments, CONSTRAINT comments_user_id_foreign FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE)

    This is a weird problem. The error only happens in local but not in production

    Its basically that the reference user in comment’s user_id has problem (non-existent etc)

    #647

    It might be because you are seeding your database and problem could arise in the process of seeding it.

    One solution is to seed your database with production data.

    #648
    dan
    Participant

    that works

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.