问题是这样的:我用powerDesigner设计的数据库,自动导出的sql语句建的表。其中有一个t_user表的一个字段n_dept_id,它是参考两个字段的,其中一个是t_dept的n_dept_id字段,另一个是t_out_dept的n_out_dept_id字段。mysql的语句如下:
alter table t_user add constraint FK_Reference_58 foreign key (n_dept_id)
      references t_dept (n_dept_id) on delete restrict on update restrict;alter table t_user add constraint FK_Reference_85 foreign key (n_dept_id)
      references t_out_dept (n_out_dept_id) on delete restrict on update restrict;问题来了:当我插入一个数据的时候,t_user表的字段n_dept_id只参考t_out_dept的n_out_dept_id字段,完全无视t_dept的n_dept_id字段。我用Mysql Front 的时候,看到索引那一列有主索引,还有FK_Reference_85 ,没有FK_Reference_58。
怎么回事呢?大神帮帮忙啊。我用的mysql版本是5.X α版的。