Giwi

1

votes
1

answer
32

views

Zero-to-Many: Cannot add or update a child row: a foreign key constraint fails

I am new to Go and Gorm. I want to parse API response and store two tables. For each 'reports' table, there can be zero-to-many tables of 'personal_details'. However, gorm gave error when applying foreign key constraint because there's no record for PersonalDetail in API response sometimes. I foll...
Giwi
0

votes
0

answer
2

views

GORM Zero-to-Many: Cannot add or update a child row: a foreign key constraint fails

I am new to Golang and Gorm. I want to parse API response and store two tables. For each 'reports' table, there can be zero-to-many tables of 'personal_details'. However, gorm gave error when applying foreign key constraint because there's no record for PersonalDetail in API response sometimes. I...
Giwi