Hello,
The problem is the following,
I have a table of friendships in my database, the friendship table has two foreign keys to the users table.
I want to set a unique key on the two foreign keys so that I will have no duplicates, but I want more, I want that if user A added user B, then B won't be able to add A, and I want to have only one row in the table that represents the friendship between A and B.
Is there any way to add such a constraint from the database server?
Until now I have maintained this constraint in my code.