Reputation: 2859
I'm trying to create an ER diagram with DataGrip 2019.3 however I get duplication of relationships. Once a "false" relay is only based on keys (t1_id:t1 id
) without any foreign keys being set at all, and after creating a foreign key the relation is already duplicated (id:t2_id_fkey id
).
I'm using PostgreSQL 12
CREATE TABLE public.t1
(
id integer NOT NULL,
name character varying COLLATE pg_catalog."default",
CONSTRAINT t1_pkey PRIMARY KEY (id)
)
CREATE TABLE public.t2
(
id integer NOT NULL,
t1_id integer NOT NULL,
namne character varying COLLATE pg_catalog."default",
CONSTRAINT t2_pkey PRIMARY KEY (id),
CONSTRAINT t2_id_fkey FOREIGN KEY (id)
REFERENCES public.t1 (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
)
Upvotes: 1
Views: 471
Reputation: 10345
In DataGrip 2019.3 the 'fake keys' were introduced. More information is here: https://www.jetbrains.com/help/datagrip/columns.html#foreign-keys
In your case I see two problems.
So, expect all this in the nearest update. Thanks!
Upvotes: 2