cirandas.net

ref: master

db/migrate/20140312132212_add_indexes_for_article_search.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
class AddIndexesForArticleSearch < ActiveRecord::Migration
  def self.up
    add_index :articles, :created_at
    add_index :articles, :hits
    add_index :articles, :comments_count
  end

  def self.down
    remove_index :articles, :created_at
    remove_index :articles, :hits
    remove_index :articles, :comments_count
  end
end