Resources

Summary

# Terminal
gem install lol_dba
cd <RAILS_PROJECT> 
lol_dba db:find_indexes

* TIP: if you have a problem with the index name('index name too long') you can solve with the :name option. Something like :name => 'my_index'.

* run `rails g migration AddMissingIndexes` and add the following content:

    class AddMissingIndexes < ActiveRecord::Migration
      def change
        add_index :comments, :user_id
        add_index :comments, :post_id
        add_index :posts, :user_id
      end
    end

# Terminal
gem install squasher
squasher YYYY/MM/DD