Is it possible, in MySQL, to create two unique indexes, together?
For example, there is a table that holds two IDs - customer ID and product ID. I would like to create uniqueness for the pair only. In simple words, combination of user and product can be present only once. The same user with another products can be present as much as needed. And the same product with another users can be present as much as needed. But the pair itself to be unique. How?
This query actually has an OR relation. I am looking for an AND relation.
ALTER TABLE top ADD CONSTRAINT unique_pair UNIQUE (uid, pid)