Help with GORM foreign key


I have a small service that receives a parent-model ‘address’ and probably a list of children ‘person’

Sometimes i get an error that the foreign key of the child fails, but when debugging, all listed children have the correct parent-id set.

When debugging GORM statements, the statement to insert the person is listed before the insert of the address, but this might be missleading. I don’t know how the logger caches…

All i do is DB.Save(address) with it’s children.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.