Index name is too long
ArgumentError: Index name 'index_loo...ng' on table 'hoges' is too long; the limit is 64 characters
というやつ。add_index
すればよいのだけど、ふと見てみたところ
class CreateHoges < ActiveRecord::Migration[5.0]
def change
create_table :hoges do |t|
t.refrences :moge, foreign_key: true, index: { name: 'mo' }
end
end
end
なんて書けるみたいですよ。というのを今知った。