Therefore the only thing left to do is run the following migration:
add_index :discounts, [:promo_code_id, :customer_id, :order_id], :unique => true add_index :discounts, [:promo_code_id, :customer_id, :order_id], :unique => trueNo comments yet.