Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么Associations章节中一对一关系和一对多关系产生的SQL是一样的 #79

Open
hlz2516 opened this issue Sep 8, 2022 · 0 comments
Labels

Comments

@hlz2516
Copy link

hlz2516 commented Sep 8, 2022

首先,一对多关系产生的SQL是没问题的。
问题在于一对一,按理说,一对一关系,任意一方的外键是是unique的,这也是能保证一对一的关键,但是在产生的SQL中没有看到unique相关的字眼。在文档中可以看到一对一关系和一对多关系产生的SQL在形式上是一样的,从我个人的角度看这是有问题的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant