I want to implement the following constraints in mysql:
create table TypeMapping(
...
constraint unique(server_id,type_id),
constraint foreign key(server_id) references Server(id),
constraint foreign key(type_id) references Type(id)
);
This throws a 'ERROR 1062 (23000): Duplicate entry '3-4' for key 'server_id'' when I issue an insert/update that would break the constraint. Is this type of constraint even possible? If so how? Thank you.