ER-diagram not displaying relationships in Datagrip(ER 图未在 Datagrip 中显示关系)
问题描述
datagrip 中的 ER 图不会显示表之间的关系,只会显示表.我正在使用 MYSQL.我也尝试过使用 MariaDB.在此处输入图片说明
ER diagrams in datagrip won't display the relationsships between tables, only the tables. I'm using MYSQL. I've also tried to use MariaDB. enter image description here
推荐答案
好的,我遇到了这个问题,发现这可能取决于你如何声明外键,至少使用MySql.
Ok, I ran across this problem, and found that it may depend on how you declare the foreign keys at least using MySql.
图表不显示使用此语法创建的表的关系,内联外键声明:
The diagram does not display relationship for tables created using this syntax, with inline foreign key declaration:
CREATE TABLE table(
my_pk int primary key,
fkrow int references other_table(fkrefrow)
);
但是如果表是用这种语法创建的,图表会显示关系箭头,在自己的行上声明外键约束:
But the diagram DOES show relationship arrow if the table is created with this syntax, declaring the foreign key constraint on its own line:
CREATE TABLE table(
my_pk int primary key,
fkrow int not null,
foreign key (fkrow) references other_table(fkrefrow)
)
这篇关于ER 图未在 Datagrip 中显示关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:ER 图未在 Datagrip 中显示关系
基础教程推荐
- 带更新的 sqlite CTE 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
