You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have table articles with columns id,id_author, id_editor. Second table is users with id and code. Models have relations on both articles columns (hasMany,belongsTo).
I need select all articles if users.code match constant or if both are null. I can't use where in include (or I don't know how for this conditions with OR).
but when I add new include with include sequelize generate SQL with subquery and where is inside subquery but joins are outside. Query fail on Unknown column 'Create_ref.code' in 'where clause'
No. This issue is relevant to Sequelize as a whole.
Yes. This issue only applies to the following dialect(s): XXX, YYY, ZZZ
I don't know.
Would you be willing to resolve this issue by submitting a Pull Request?
Yes, I have the time and I know how to start.
Yes, I have the time but I don't know how to start, I would need guidance.
No, I don't have the time, although I believe I could do it if I had the time...
No, I don't have the time and I wouldn't even know how to start.
I tried it also on 5.21.3 and 6.0.0-beta 4, same error. I used mysql2 engine.
I found a quick fix. Add separate: true, to last include and split query but it is not a proper solution.
The text was updated successfully, but these errors were encountered:
sneznaovca
added
the
type: docs
For issues and PRs. Things related to documentation, such as changes in the manuals / API reference.
label
Jan 31, 2020
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 table
articles
with columnsid
,id_author
,id_editor
. Second table isusers
withid
andcode
. Models have relations on botharticles
columns (hasMany
,belongsTo
).I need select all
articles
if users.code match constant or if both are null. I can't use where in include (or I don't know how for this conditions with OR).I have something like..and it works correct
but when I add new include with include sequelize generate SQL with subquery and where is inside subquery but joins are outside. Query fail on
Unknown column 'Create_ref.code' in 'where clause'
Is it bug or I need different approach?
Issue Template Checklist
Is this issue dialect-specific?
Would you be willing to resolve this issue by submitting a Pull Request?
I tried it also on 5.21.3 and 6.0.0-beta 4, same error. I used mysql2 engine.
I found a quick fix. Add
separate: true,
to last include and split query but it is not a proper solution.The text was updated successfully, but these errors were encountered: