Commit 5c97f0868c0785f9d401e8906874932adc882ff7

Authored by Rodrigo Souto
1 parent fa1fa8c1

schema: adding index for products search

(ActionItem3039)
db/migrate/20140314200103_add_indexes_for_products_search.rb 0 → 100644
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  1 +class AddIndexesForProductsSearch < ActiveRecord::Migration
  2 + def self.up
  3 + add_index :products, :created_at
  4 + end
  5 +
  6 + def self.down
  7 + remove_index :products, :created_at
  8 + end
  9 +end
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 # 9 #
10 # It's strongly recommended to check this file into your version control system. 10 # It's strongly recommended to check this file into your version control system.
11 11
12 -ActiveRecord::Schema.define(:version => 20140313213142) do 12 +ActiveRecord::Schema.define(:version => 20140314200103) do
13 13
14 create_table "abuse_reports", :force => true do |t| 14 create_table "abuse_reports", :force => true do |t|
15 t.integer "reporter_id" 15 t.integer "reporter_id"
@@ -432,6 +432,7 @@ ActiveRecord::Schema.define(:version =&gt; 20140313213142) do @@ -432,6 +432,7 @@ ActiveRecord::Schema.define(:version =&gt; 20140313213142) do
432 t.integer "image_id" 432 t.integer "image_id"
433 end 433 end
434 434
  435 + add_index "products", ["created_at"], :name => "index_products_on_created_at"
435 add_index "products", ["enterprise_id"], :name => "index_products_on_enterprise_id" 436 add_index "products", ["enterprise_id"], :name => "index_products_on_enterprise_id"
436 add_index "products", ["product_category_id"], :name => "index_products_on_product_category_id" 437 add_index "products", ["product_category_id"], :name => "index_products_on_product_category_id"
437 438