lol_dba icon indicating copy to clipboard operation
lol_dba copied to clipboard

has_many: indexes being created for inexistent columns

Open plentz opened this issue 9 years ago • 1 comments

This is being fixed @ has_many_fix branch. This is the failing case that should be fixed https://github.com/plentz/lol_dba/commit/bf9c4eb7124d3f998d6cf65ffb3165a2068b4335#diff-d90d1bc62234f746df962016d75e56c8R58

plentz avatar Oct 11 '16 20:10 plentz

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

tuykin avatar Nov 19 '18 01:11 tuykin