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
Query related models without primary key #6929
Comments
This is not a solution as I'm trying to learn things with this community.
Although the primary may not be defined in your database. |
The
The
The
So, when I'd perform a |
In theory I think an perhaps forging |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment 🙂 |
I'm not certain if this is a bug or just a quirk that needs to be documented better.
(Possibly related to #1485)
When querying a model with includes using a
hasMany
relationship, if the model being included does not have aprimaryKey
set only 1 record will be included in the final model.In the case that I stumbled into, I have a model which has a unique index using a UUID column (
userId
) and string column (emailAddress
). Together, these two are sufficiently unique and should not require a dedicatedid
attribute for the tuple, but only 1 record would return from this model without aprimaryKey
attribute on one of the columns.Is this expected behavior? Is there a potential fix that I've overlooked?
The text was updated successfully, but these errors were encountered: