Bug 1267538

Summary: Wrong Foreign Key reference when exporting Dynamic VDB
Product: [JBoss] JBoss Data Virtualization 6 Reporter: Andrej Smigala <asmigala>
Component: ToolingAssignee: Barry LaFond <blafond>
Status: CLOSED CURRENTRELEASE QA Contact: Andrej Smigala <asmigala>
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: mmakovy, vhalbert
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-17 18:06:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
project none

Description Andrej Smigala 2015-09-30 11:03:58 UTC
Created attachment 1078592 [details]
project

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:

CONSTRAINT FK_SPLIER_PRTS_SPLY FOREIGN KEY(SUPPLIER_ID) REFERENCES SUPPLIER_PARTS(SUPPLIER_ID)

which is obviously wrong. The correct constrant definition should be:

CONSTRAINT FK_SPLIER_PRTS_SPLY FOREIGN KEY(SUPPLIER_ID) REFERENCES SUPPLIER(SUPPLIER_ID)


Steps to Reproduce:
# import the attached project
# right click the vdb, select Modeling -> Generate Dynamic VDB
# click Next, click Generate
# find the DDL for table SUPPLIER_PARTS, notice the FOREIGN KEY definitions

Comment 2 JBoss JIRA Server 2015-09-30 15:20:53 UTC
Barry LaFond <blafond> updated the status of jira TEIIDDES-2672 to Resolved

Comment 3 JBoss JIRA Server 2015-10-20 07:14:45 UTC
Matus Makovy <mmakovy> updated the status of jira TEIIDDES-2672 to Closed