cirandas.net

ref: master

db/migrate/20140708121356_index_articles_filtered_fields.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
class IndexArticlesFilteredFields < ActiveRecord::Migration
  def self.up
    %w[articles article_versions].each do |table|
      add_index table, [:parent_id]
      add_index table, [:path]
      add_index table, [:path, :profile_id]
    end
    add_index :articles, [:type]
    add_index :articles, [:type, :parent_id]
    add_index :articles, [:type, :profile_id]
  end

end