The idea of a foreign key is that is is, well, a *foreign key* :-) It's
meant to match up data that is in one table with data that is in another
table, and a constant obviously isn't data in your table. To be precise,
what you specify in your constraint are not even fields, but *indices* - and
a
Hi,
I have the following table:
create table client(
id int unsigned not null auto_increment primary key,
name varchar(200),
type1 int unsigned not null,
type2 int unsigned not null,
constraint foreign key(type1, type2) references constants(id, type)
) engine=InnoDB;
This table is OK, but the