Why DataGrip automatically creates Foreign Key relation when 'table_id' column is added

All we need is an easy explanation of the problem, so here it is.

Not long ago I started using DataGrip from Jetbrains, I am using postgres

when I add column ‘table_id’ foreign key relation is automaitcally is created between tables, though I didn’t add any FOREIGN KEY statements. Do you know why relation is created automatically, when I just added tablename_id?

Why DataGrip automatically creates Foreign Key relation when 'table_id' column is added

Why DataGrip automatically creates Foreign Key relation when 'table_id' column is added

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

That relationships are virtual. It means that they don’t exist in the database, but DataGrip creates them based on names trying to guess what connections your database has. If you don’t want to see them on the diagram, turn the displaying of them off via that button: Why DataGrip automatically creates Foreign Key relation when 'table_id' column is added

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply