Multiple primary keys with Doctrine 1 and Symfony 1?

后端 未结 2 1920
一整个雨季
一整个雨季 2021-01-26 06:31

I already know that\'s not possible to work with multiple primary keys in Symfony 1 and Doctrine 1, but do you guys know any good workarounds?

2条回答
  •  隐瞒了意图╮
    2021-01-26 07:12

    A common workaround is to add an auto_increment key to the many-to-many resolver table, and rather than have defining relationships, just make standard foreign key relationships to the tables. As long as you have an index on the two columns performance will be fine.

提交回复
热议问题