Skip to content

Commit

Permalink
Bug 2857682 - Resolved problem where remote tables thought tables in …
Browse files Browse the repository at this point in the history
…original schema were newly discovered remote tables.
  • Loading branch information
johncurrier committed Oct 5, 2009
1 parent 36aaac0 commit 7fa75cd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/net/sourceforge/schemaspy/model/Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,15 @@ protected void addForeignKey(String fkName, String fkColName,
foreignKey.addChildColumn(childColumn);

Table parentTable = tables.get(pkTableName);
String otherSchema = pkTableSchema;
String parentSchema = pkTableSchema;
String baseSchema = Config.getInstance().getSchema();

// if named table doesn't exist in this schema
// or exists here but really referencing same named table in another schema
if (parentTable == null || (otherSchema != null && !otherSchema.equals(getSchema()))) {
parentTable = db.addRemoteTable(otherSchema, pkTableName, getSchema(),
if (parentTable == null ||
(baseSchema != null && parentSchema != null &&
!baseSchema.equals(parentSchema))) {
parentTable = db.addRemoteTable(parentSchema, pkTableName, baseSchema,
properties, excludeIndirectColumns, excludeColumns);
}

Expand Down

0 comments on commit 7fa75cd

Please sign in to comment.