EDIT: I think I just found out why this problem occurs. When adding a Foreign Key to a table, you can no longer specify whether the columns in that FK are mandatory or not. Instead you have to mark the entire relationship as mandatory or not. And even when the relationship isn't mandatory, you can no longer mark individual columns as mandatory. Clearly (given the DDL below) that's a bad restriction. Is this a known problem, and will it be fixed?
Original bug report:
Data Modeler 4.0.3.853 seems to have a problem with this DDL (which is a reduced test case):
CREATE TABLE T2 (
T1_ID NUMBER NOT NULL,
T2_ID NUMBER NOT NULL
);
ALTER TABLE T2 ADD CONSTRAINT T2_PK PRIMARY KEY ( T1_ID, T2_ID );
CREATE TABLE T3 (
T1_ID NUMBER NOT NULL,
T2_ID NUMBER,
T3_ID NUMBER NOT NULL
);
ALTER TABLE T3 ADD CONSTRAINT T2_T3_FK FOREIGN KEY ( T1_ID, T2_ID ) REFERENCES T2 ( T1_ID, T2_ID );
Things to note:
- There is no PK on table T3, only an FK that references T2.
- The column T3.T2_ID is allowed to be NULL
When I import this DDL into Data Modeler using File->Import->DDL File (using an Oracle Database 11g site, in case it matters), the resulting model has D3.T2_ID marked as required. Clearly this column should not be marked as required.
Interesting things:
- If I remove all references to T1_ID, the problem goes away and D3.T2_ID is not marked required.
- If I make T3.T1_ID optional as well, the problem goes away and D3.T2_ID is not marked required.
Putting this out there in the hope that it will get fixed
Message was edited by: user10440593