php - Encountering problems with related tables when filling data using Laravel 5.4 fzaninotto/Faker, how to fill the data?
巴扎黑
巴扎黑 2017-05-16 13:14:54
0
1
513

1. There are existing tables raceinfo and groupinfo. The field race_id of table groupinfo is associated with the primary key of table raceinfo.
2. When using fzaninotto/Faker to fill data into table groupinfo, data filling failure will occur.
Question: How to solve the problem of foreign key association between two related tables and successfully fill in false data?

巴扎黑
巴扎黑

reply all(1)
迷茫

Just turn off the foreign key constraints before starting to fill in the data.
It doesn’t matter if the filling is completed or not. Closing constraints is only valid for the current database connection.

http://laravelacademy.org/pos...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template