We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Identity.where
Describe the bug The Identity.where option is being ignored.
To Reproduce
For example,
identities do identity :foo_bar, [:foo], where: :bar_is_ten end postgres do identity_wheres_to_sql [bar_is_ten: "bar = 10", foo_bar: "bar = 20"] end
This results in bar_is_ten being ignored, and it creates the following with where: "bar = 20" instead:
create unique_index(:my_table, ["foo"], name: "foo_bar_index", where: "bar = 20")
Expected behavior
A migration with "bar = 10"
create unique_index(:my_table, ["foo"], name: "foo_bar_index", where: "bar = 10")
The text was updated successfully, but these errors were encountered:
The way that you're writing it is incorrect. The key is the identity name and the value is the SQL where clause.
identities do identity :foo_bar, [:foo], where: expr(bar == 10) end postgres do identity_wheres_to_sql [foo_bar: "bar = 10"] end
Sorry, something went wrong.
@zachdaniel
So, the expression expr(bar == 10) in the where clause is not actually being used, right?
expr(bar == 10)
I'm just asking for confirmation. 😄
It's not being used to generate the filter in Postgres cases, no. (Because we don't have an expr -> raw SQL converter yet), it's all Ecto expressions.
Successfully merging a pull request may close this issue.
Describe the bug
The Identity.where option is being ignored.
To Reproduce
For example,
This results in bar_is_ten being ignored, and it creates the following with where: "bar = 20" instead:
Expected behavior
A migration with "bar = 10"
The text was updated successfully, but these errors were encountered: