Skip to content

Commit b9cdb5e

Browse files
committed
Add a multi-column index on spree_reviews.approved + spree_reviews.product_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).
1 parent 5e7965f commit b9cdb5e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class IndexProductIdAndApproved < ActiveRecord::Migration[5.1]
2+
def change
3+
add_index :spree_reviews, :product_id
4+
add_index :spree_reviews, :approved
5+
end
6+
end

0 commit comments

Comments
 (0)