Diagram not showing relation? Foreign Key constraint is there...

Answered

Hello!

I'm currently trying out DataGrip and am facing a dead end here. I have created a very basic database in another program and DataGrip actually gets the data right, but it doesn't show the relation. I didn't find anything I had to enable to get this to work.

 

you can see the book_fk, but it doesn't show up in the diagram.

Any ideas?

8
10 comments
Avatar
Permanently deleted user

I have the same problem using SQLite. With MySQL works fine. I believe this is because SQLite does not enforce foreign keys (http://sqlite.org/foreignkeys.html)

0

Hello,

It is known issue with table relations not displaying. Please vote and follow related requests in YouTrack: https://youtrack.jetbrains.com/issue/DBE-1781https://youtrack.jetbrains.com/issue/DBE-2130 .

1
Avatar
Permanently deleted user

Any fix expected soon?

0

Currently I have no ETA for this. Most probably not in the nearest DataGrip versions.

0
Avatar
Permanently deleted user

Any update? I see foreign keys for MySQL just fine but they're missing altogether for DB2. DbVisualizer has no issues with it.

0
Avatar
Permanently deleted user

I have also run into this issue. Is there any chance that we'll be getting a fix?

1
The bug's still not fixed.So vizualization mode is not working.
0

Atalipov,

Could you provide a sample DDL to reproduce the issue?

0

Yes, sure.

I use Database Tools and SQL plugin 211.7442.57.

--
-- PostgreSQL database dump
--

-- Dumped from database version 9.6.22
-- Dumped by pg_dump version 9.6.22

CREATE SCHEMA s2;

ALTER SCHEMA s2 OWNER TO postgres;

CREATE TABLE s2.work_block (
work_item_id bigint NOT NULL
);

ALTER TABLE s2.work_block OWNER TO postgres;

CREATE TABLE s2.work_board (
work_item_id bigint NOT NULL
);

ALTER TABLE s2.work_board OWNER TO postgres;

CREATE TABLE s2.work_item (
item_id bigint NOT NULL,
work_type smallint
);

ALTER TABLE s2.work_item OWNER TO postgres;

CREATE SEQUENCE s2.work_item_item_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

ALTER TABLE s2.work_item_item_id_seq OWNER TO postgres;

ALTER SEQUENCE s2.work_item_item_id_seq OWNED BY s2.work_item.item_id;

ALTER TABLE ONLY s2.work_block
ADD CONSTRAINT work_block_pkey PRIMARY KEY (work_item_id);

ALTER TABLE ONLY s2.work_board
ADD CONSTRAINT work_board_pkey PRIMARY KEY (work_item_id);

ALTER TABLE ONLY s2.work_item
ADD CONSTRAINT work_item_pkey PRIMARY KEY (item_id);

ALTER TABLE ONLY s2.work_item
ADD CONSTRAINT work_item__work_block FOREIGN KEY (item_id) REFERENCES s2.work_block(work_item_id);

ALTER TABLE ONLY s2.work_item
ADD CONSTRAINT work_item__work_board FOREIGN KEY (item_id) REFERENCES s2.work_board(work_item_id);
0

Atalipov,

I submitted a new issue DBE-13750 based on your description.

1

Please sign in to leave a comment.