retrospring/db/migrate/20200509094402_add_some_indexes.rb
Georg Gadinger 75e9a12493 Add indexes to some heavily used tables
haha queries go brrr
2020-05-09 12:07:18 +02:00

13 lines
388 B
Ruby

# frozen_string_literal: true
class AddSomeIndexes < ActiveRecord::Migration[5.2]
def change
add_index :answers, :question_id
add_index :comments, :answer_id
add_index :inboxes, :user_id
add_index :reports, %i[type target_id]
add_index :reports, %i[user_id created_at]
add_index :services, :user_id
add_index :subscriptions, %i[user_id answer_id]
end
end