I\'m trying to write a trigger that raises error when someone attemps to rate a product which has not been bought. I have come up with a query to get the purchase history of a c