Skip to content

Commit

Permalink
0003682: XML table definitions with FK do not need to provide catalog
Browse files Browse the repository at this point in the history
and schema for the FK if it is in the same as the table
  • Loading branch information
jumpmind-josh committed Aug 20, 2018
1 parent 9a248e6 commit ee43b22
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -520,8 +520,10 @@ public static void write(Table table, Writer output) {
for (ForeignKey fk : table.getForeignKeys()) {
output.write("\t\t<foreign-key name=\"" + StringEscapeUtils.escapeXml(fk.getName()) + "\" foreignTable=\""
+ StringEscapeUtils.escapeXml(fk.getForeignTableName()) + "\" foreignTableCatalog=\""
+ StringEscapeUtils.escapeXml(fk.getForeignTableCatalog() == null ? "" : fk.getForeignTableCatalog()) +
"\" foreignTableSchema=\"" + StringEscapeUtils.escapeXml(fk.getForeignTableSchema() == null ? "" : fk.getForeignTableSchema()) + "\">\n");
+ StringEscapeUtils.escapeXml(fk.getForeignTableCatalog() == null || fk.getForeignTableCatalog().equals(table.getOldCatalog())
? "" : fk.getForeignTableCatalog()) +
"\" foreignTableSchema=\"" + StringEscapeUtils.escapeXml(fk.getForeignTableSchema() == null ||
fk.getForeignTableSchema().equals(table.getOldSchema()) ? "" : fk.getForeignTableSchema()) + "\">\n");

for (Reference ref : fk.getReferences()) {
output.write("\t\t\t<reference local=\"" + StringEscapeUtils.escapeXml(ref.getLocalColumnName())
Expand Down

0 comments on commit ee43b22

Please sign in to comment.