What is the correct way to draw a relationship in Lucid Chart that will result in valid SQL Server syntax for a foreign key to a compound primary key?
For instance, if I have two tables
Child.Id1 and Child.Id2 form a foreign key to the compound primary key (Id1, Id2) in Parent. I can draw two individual lines from Parent to Child to indicate the relationship,
but this produces SQL that is not valid
CREATE TABLE AParent] (
Id1] int,
rId2] int,
bDesc] varchar(255),
PRIMARY KEY (AId1], Id2])
);
CREATE TABLE TChild] (
(Id1] int,
tId2] int,
nId3] int,
PRIMARY KEY (PId1], Id2], IId3]),
CONSTRAINT FK_Child.Id1]
FOREIGN KEY (Id1])
REFERENCES Parent](EId1]),
CONSTRAINT
REFERENCES bParent](Id2])
);
The correct syntax would be more like
CREATE TABLE Child] (
EId1] int,
bId2] int,
FOREIGN KEY (dId1],
Furthermore, if I create these tables directly in SQL Server with the correct relationship and import them into Lucid using the ERD import, they draw out with the two lines connecting the entities. If I then export the ERD again to SQL Server, it creates the same invalid SQL as above with the two independent foreign keys.
I’m fairly new to Lucid, so I may be missing something obvious and any help is appreciated.
Thanks!