-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Model has-one-through relations #14511
Conversation
already exist, it can be reused.
Added alias to test model
Codecov Report
@@ Coverage Diff @@
## 4.0.x #14511 +/- ##
==========================================
- Coverage 67.74% 67.7% -0.05%
==========================================
Files 482 482
Lines 111424 111754 +330
==========================================
+ Hits 75483 75659 +176
- Misses 35941 36095 +154 |
Thank you @zsilbi |
@zsilbi Could you explain why it's anti-pattern? I genuinely want to know. I thought it's perfectly normal to design database that way if you want to have an optional relationship and normalized database, i.e. document document_approved_by user instead of document Thanks and also thanks for PR :) |
What I think I really meant there, that performance wise there can be better alternatives to this. |
Hello!
In raising this pull request, I confirm the following:
Small description of change:
This is very similar to
hasManyToMany
, but it can only use one intermediate row.The related record is either
ModelInterface
, ornull
.This is kind of an antipattern, but it can be useful when you have to work with a poorly designed database structure that can't be altered.
Thanks,
zsilbi