diff --git a/db/migrate/20140314200103_add_indexes_for_products_search.rb b/db/migrate/20140314200103_add_indexes_for_products_search.rb new file mode 100644 index 0000000..de4912d --- /dev/null +++ b/db/migrate/20140314200103_add_indexes_for_products_search.rb @@ -0,0 +1,9 @@ +class AddIndexesForProductsSearch < ActiveRecord::Migration + def self.up + add_index :products, :created_at + end + + def self.down + remove_index :products, :created_at + end +end diff --git a/db/schema.rb b/db/schema.rb index af91734..3d7aef5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20140313213142) do +ActiveRecord::Schema.define(:version => 20140314200103) do create_table "abuse_reports", :force => true do |t| t.integer "reporter_id" @@ -432,6 +432,7 @@ ActiveRecord::Schema.define(:version => 20140313213142) do t.integer "image_id" end + add_index "products", ["created_at"], :name => "index_products_on_created_at" add_index "products", ["enterprise_id"], :name => "index_products_on_enterprise_id" add_index "products", ["product_category_id"], :name => "index_products_on_product_category_id" -- libgit2 0.21.2