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
Top level where clauses for nested includes ignored when using findByPk #13511
Comments
Can you add some code samples for this? I don't fully understand the issue. Te generated SQL vs what you expect would also be super handy (if logging isn't already on, you can add |
This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂 |
This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂 |
I have the same problem. This is the code that triggered the error for me:
And the MySQL query that it generates is the following:
The top-level where conditions are completely ignored in the resulting query. The only way I've figured out how to solve it is simple. Just change |
Perhaps something needs to be added to the docs about this, or update the findByPk method to apply any nested where clause?
The text was updated successfully, but these errors were encountered: