Sorry for the newbie question - did I understand correctly that these two operators are identical in Mysql?
ALTER TABLE friends ADD CONSTRAINT UNIQUE (`user_id`, `friend_id`);
and
CREATE UNIQUE INDEX friends_user_friend ON friends (user_id, friend_id);
source
to share