-
Notifications
You must be signed in to change notification settings - Fork 19
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
Does not recognize expression indexes in Postgres #34
Comments
Ah interesting, yeah this seems like a really useful feature - I'm surprised I haven't heard about it before! This one and the other issue you opened look like they would be pretty hard to determine reliably and in full generality from a library's perspective. It makes me think maybe the right solution is to provide a way to tell consistency_fail to just ignore some specific "issues" that it detects. Maybe some input file of ignores, something like But if anyone sees a nice way to actually implement the ideal solution (we correctly detect indexes like the above), then I'm all for that too, of course. |
@adsteel did u ever come up with a workaround for this? just ran into this issue myself. |
@kelvintyb I did not. |
If you are using
structure.sql
in your Rails + Postgres project, you have the ability to use expression indexes. For example:This can be mirrored in your ActiveRecord model:
With the above combination, the db constraint is consistent with the model, but this gem does not recognize it. The large number of expression indexes I have on my current project makes this gem difficult to use, though I understand that this practice is probably not too common in the Rails community.
The text was updated successfully, but these errors were encountered: