简体   繁体   English

MySQL不显示也是主键的外键

[英]MySQL not showing foreign keys that are also primary keys

Navicat does not show primary keys which are also foreign key on table report as foreign keys. Navicat不显示主键,主键在表报表中也作为外键显示。 Why? 为什么?

I gave the image explaining the situation: 我给出了解释情况的图像:

替代文字

A foreign key is a constraint that applies only to the referencing table. 外键是仅适用于引用表的约束。 In your case, the translate_talent_id field has a foreign key constraint that references another field of another table. 在您的情况下, translate_talent_id字段具有引用另一个表的另一个字段的外键约束。

On the other hand, translator_id is probably referenced by foreign keys in other tables. 另一方面, translator_id可能被其他表中的外键引用。 However, such foreign keys won't appear (or have any effect) on the the referenced table ( trl_translator in this case). 但是,这样的外键将不会出现在引用的表上(或在其中起作用)(在这种情况下为trl_translator )。 That is why your MySQL client is not showing any foreign keys on translator_id . 这就是为什么您的MySQL客户端未在translator_id上显示任何外键的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM