Skip to content
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

has_many: indexes being created for inexistent columns #76

Open
plentz opened this issue Oct 11, 2016 · 1 comment
Open

has_many: indexes being created for inexistent columns #76

plentz opened this issue Oct 11, 2016 · 1 comment
Labels

Comments

@plentz
Copy link
Owner

plentz commented Oct 11, 2016

This is being fixed @ has_many_fix branch. This is the failing case that should be fixed bf9c4eb#diff-d90d1bc62234f746df962016d75e56c8R58

@plentz plentz added the bug label Oct 11, 2016
@plentz plentz changed the title has_many: inexistent indexes being created in a few cases has_many: indexes being created for inexistent columns May 8, 2018
@tuykin
Copy link

tuykin commented Nov 19, 2018

foreign_key and foreign_type modifiers are not counted.

Here's my case:

# content.rb
class Content < ApplicationRecord
  belongs_to :material, polymorphic: true, foreign_key: :id_content, foreign_type: :type_content
end

Index suggested to add:

add_index :contents, [:material_id, :material_type]

I don't know, if I should create separate issue for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants