Closed ercasta closed 8 years ago
Why would a record in a table reference itself? Seems pointless.
Sorry, you're right. The datamodel I'm looking at is wrong. At first sight, it seemed the columns in the primary key were constrained to reference the primary key of another table, but actually they are referencing themselves. This configuration should anyway be harmless so I agree with your change (70927ec)
Thanks, The only reason you may want to model something like this is to prevent deletes. The best way to do that would be to set appropriate permissions.
I think it's just a mistake in the datamodel. Most likely the foreign key was intended to refer to another table, to create a table containing additional information for an already existing entity, without changing the original table
Fixed in 14.08.01
Please see #71
I have released SchemaCrawler 14.08.04 with a fix that supports self-referencing foreign keys in database diagrams.
I'm trying to generate a diagram for a schema containing a table whose primary key also has foreign key constraint on it.
Schemacrawler throws an exception complaining that "Primary key column cannot equal foreign key column".
Is there any limitation in Schemacrawler that prevents this configuration to be handled? There is an explicit check in
schemacrawler-api/src/main/java/schemacrawler/crawl/BaseColumnReference.java
Regards