I\'ve run into the same problem in two different pieces of work this month:
Version 1: User 1 & User 2 are friends
Version 2: Axis 1 & Axis 2 when gr
In SQL it's easy to implement the constraints to support your first approach:
CREATE TABLE MutualFriendship
(u1 VARCHAR(10) NOT NULL,
u2 VARCHAR(10) NOT NULL,
PRIMARY KEY (u1,u2),
FOREIGN KEY (u2,u1) REFERENCES MutualFriendship (u1,u2));
INSERT INTO MutualFriendship VALUES
('Alice','Bob'),
('Bob','Alice');