0
是否需要在HABTM連接表上添加_index?我使用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