Skip to main content

I'm exporting an ERD to SQL Server. The diagram consists of one entity with relationships to three other tables. Looking at the generated SQL the foreign keys are set up incorrectly. A FK that references table A for example uses the column that is the foreign key to table B.

Am I doing something wrong? Any way to fix this other than manually edit the generated SQL each time I export?

I found the problem. The relationships need to be connected to the corresponding table at the connection points for the corresponding columns. 

Issue resolved.


Hi Paul thanks for following up with that resolution! If anyone else is experiencing issues with ERD > SQL export feel free to post your question in this thread.


The query provided by Lucidchart import (ERD > SQL export) is not retrieving the foreign keys at all.  As a result the tables are not connecting with each other when I drag them into the doc.  I'm using a PostgreSQL DB and there are foreign keys defined in the schema for my DB.  Would appreciate any help in tweaking the query to pull the FKs.  Thanks!


Hi Yasir thanks for commenting in our community! You've provided some great information about the problems you are experiencing with our ERD import. I am going to have a member of our support team reach out with some more specific questions via email so we can take a deeper look. 


I am having a similar issue with my ERD exporting to PostgreSQL. About one-half (8 of 15) FK relationships are not exporting, and ultimately are not created. 

How do we verify the connections are made between the two. For instance, I connect the PK of the sub-table to an FK in the primary table visually but, when exporting, that relationship disappears. 

When exporting a CSV from my manually created ERD, the relationships appear in the appropriate columns. So, this suggests to me the code export to PostgreSQL is the primary issue.

I have screenshots and the various code documents to send but, would appreciate answers being published here for the next person. 

Any help would be appreciated.


Hi ​@jerryhall

Thank you for your reply to this thread! It sounds like you may be experiencing a current bug in our system. Do you mind checking out this post to see if you are experiencing the same / related issue? 

 


Reply