jeudi 2 juin 2016

Getting error while creating foreign key in laravel 5 application

I am creating a laravel application but while creating foreign keys, i am getting errors. I have 2 tables users and articles i want to connect to tables such that each user will have seprate articles.

You can check for more code on http://ift.tt/24kd55t

FOREIGN KEY (article_id) REFERENCES Persons(user_id)

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`app`.`users`, CONSTRAINT `users_ibfk_1` FOREIGN KEY (`id`) REFERENCES `articles` (`article_id`)) (SQL: insert into `users` (`name`, `email`, `password`, `updated_at`, `created_at`) values (jatin, jatinbalodhi@gmail.com, 



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire