0
Нужно ли добавлять add_index в таблицу соединений HABTM? Я использую t.belongs_to (aka t.references). Вот кодПодходит ли индекс HABTM для совместного использования?
class CreateCohortsUsersTable < ActiveRecord::Migration
def change
create_table :cohorts_users, :id => false do |t|
t.belongs_to :cohort
t.belongs_to :user
end
add_index :cohorts_users, :cohort_id # Do I need this?
add_index :cohorts_users, :user_id # Do I need this?
end
end