1 2 3 4 5
class AddIndexSpanningUsersAndReviews < ActiveRecord::Migration[7.0] def change add_index(:product_reviews, [:product_id, :user_account_id], unique: true) end end