我有这个复杂的关系
`School` has one to many with `rules`
`Games` has many to many `rules`
Games
与School
但是对于每所学校,同样的游戏有不同的规则
IE。我需要有三个 id 的表
school_id , game_id , rule_id
到目前为止,我只能与两个实体建立关系,但我不知道如何在关系中建立三个实体
假设我与game
and有简单的关系rules
。
IE S1 has R1 R2 R3
和S2 HAS R4 R5 R6
现在游戏假设G1 for S1 has is linked to R1 R2 and for S2 linked to R4 R5
我得到的问题是当我编辑任何学校的数据时,学说首先删除所有学校的所有其他值,然后插入新值。
理想情况下,它应该只更新该学校的 avlues