gorm icon indicating copy to clipboard operation
gorm copied to clipboard

Multiple foreign keys saving problem

Open ldmi3i opened this issue 1 year ago • 0 comments

GORM Playground Link

https://github.com/go-gorm/playground/pull/513

Description

The case of using several foreign keys to different tables which on higher table connects to single parent table could cause problems on save (using Create from parent entity). It looks like one of the relations is ignored or shadowed by the other. A problem exists when populating both foreign keys. When populate only one of the keys works correctly. For exact data structure and test case see related PR.

ldmi3i avatar Sep 03 '22 17:09 ldmi3i