-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Ecto.Migration.index/3
silently mishandles multiple :where
clauses
#2690
Comments
nathanl
changed the title
#
Sep 18, 2018
Ecto.Migration.index/3
silently mishandles multiple :where
clausesEcto.Migration.index/3
silently mishandles multiple :where
clauses
Given those are strings and not query expressions, I think we can detect and raise then. PR please? :) |
I'll try to make a PR for this in the next week or two. |
josevalim
added a commit
that referenced
this issue
Sep 21, 2018
Because multiple `where:` keywords are supported by Ecto.Query, users may provide multiple `where:` keywords when declaring a partial index. However, this is not supported. Previously, this would fail in a surprising way: the final `where:` would be used and the other discarded. Now we raise an error, explaining that these clauses should be combined into a single string. Fixes #2690
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Problem
Ecto.Query.from
allows multiplewhere:
clauses. So it seems natural to use multiplewhere:
clauses when creating an index withEcto.Migration
. However, doing so fails in a surprising way.Current behavior
This statement:
...creates an index where only the second
where:
clause is used.Expected behavior
Either
index/3
should combine allwhere:
clauses usingAND
, or it should raise an error when multiplewhere:
clauses are given, suggesting that the user combine them.The text was updated successfully, but these errors were encountered: