]
Barry LaFond commented on TEIIDDES-2672:
----------------------------------------
master:
Wrong Foreign Key reference when exporting Dynamic VDB
------------------------------------------------------
Key: TEIIDDES-2672
URL:
https://issues.jboss.org/browse/TEIIDDES-2672
Project: Teiid Designer
Issue Type: Bug
Components: Import/Export, Modeling, VDB & Execution
Affects Versions: 9.0.4
Reporter: Andrej Šmigala
Assignee: Barry LaFond
Fix For: 9.0.4, 9.2
Attachments: DynamicVdbFk.zip
When creating a dynamic VDB from an existing VDB, Foreign Key definitions use the wrong
table in the REFERENCES clause. The reference table is the same as the one that contains
this FK.
For example, in the table SUPPLIER_PARTS, the following constraint is generated:
{code:sql}CONSTRAINT FK_SPLIER_PRTS_SPLY FOREIGN KEY(SUPPLIER_ID) REFERENCES
SUPPLIER_PARTS(SUPPLIER_ID){code}
which is obviously wrong. The correct constrant definition should be:
{code:sql}CONSTRAINT FK_SPLIER_PRTS_SPLY FOREIGN KEY(SUPPLIER_ID) REFERENCES
SUPPLIER(SUPPLIER_ID){code}