I have the following database structure :
my_user ( id, name );
my_country (id, name );
my_travel ( id_user , id_country , length_of_stay );
id_user AND id_country are both external keys. They references my_user
In mysql, innoDB engine, is it better to :
1/ add 2 foreign key constraints to my_travel.id_user and
2/ add only one unique key on (id_user, id_country)
The basic fact is : when I add foreign key constraints AND unique key,
mysql tells me that my_travel fields should'nt be part of an unique and
foregn key in the same time.
Any ideas ...