antonioribeiro / antonioribeiro/tracker

Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

Open
#327 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
2.9k
Forks
594
PR merge metrics
No merged PRs in 30d

Description

Just finished the setup (on Laravel 5.5) and getting:

` Illuminate \ Database \ QueryException (23000)
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`crdc`.`tracker_log`, CONSTRAINT `tracker_log_session_id_foreign` FOREIGN KEY (`session_id`) REFERENCES `tracker_sessions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE) (SQL: insert into `tracker_log` (`session_id`, `method`, `path_id`, `query_id`, `referer_id`, `is_ajax`, `is_secure`, `is_json`, `wants_json`, `updated_at`, `created_at`) values (1, GET, , , , 0, 0, 0, 0, 2017-09-28 15:00:16, 2017-09-28 15:00:16))`

Any idea on this one?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names Laravel 5.5 and a foreign key from tracker_log.session_id to tracker_sessions.id, but no source file or test. Start by reproducing the setup and tracing creation of the session and log records; done means the reported insert succeeds without the constraint violation, with regression coverage if the repository has relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.