Skip to content

Commit

Permalink
Add a multi-column index on spree_reviews.approved + spree_reviews.pr…
Browse files Browse the repository at this point in the history
…oduct_id

Index these columns as they are used for scoping records
in the stock gem controllers (and likely used in any
custom controllers users are likely to write as well).
  • Loading branch information
nzaillian committed Oct 4, 2017
1 parent 5e7965f commit 0f3d283
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions db/migrate/20171004122538_index_product_id_and_approved.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class IndexProductIdAndApproved < ActiveRecord::Migration[5.1]
def change
add_index :spree_reviews, [:approved, :product_id]
end
end

0 comments on commit 0f3d283

Please sign in to comment.