-
Notifications
You must be signed in to change notification settings - Fork 51
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
Can't use compound index with association ID #219
Labels
bug
Something that was working before, dont anymore.
Comments
This is indeed a bug that needs to be fixed in the scope declaration of the unique constraint. Meanwhile, you can declare the scope to be field :gid, required: true, unique: { scope: :source_id } |
Setting the scope and the index to use |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to create a compound index that includes a belongs-to association. Here's a short example:
If I specify the index as
[:source, :gid]
, thewhere
call gives a warning that no index is used.If I specify the index as
[:source_id, :gid]
, it tries to use the index, but fails with:The text was updated successfully, but these errors were encountered: