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
Asked
Active
Viewed 2,390 times
1
-
Please provide more detail, maybe query, code, screenshot or something that may help us understand your question easier – koceeng Feb 28 '17 at 11:04
-
I don't have enough reputation to add pictures – andershopl Feb 28 '17 at 11:16
-
Do you have `FOREIGN KEYS` defined? – Rick James Mar 01 '17 at 23:24
1 Answers
1
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)
)

Guy Starbuck
- 21,603
- 7
- 53
- 64