Skip to content

Commit

Permalink
0005834: Unnamed constraint causes alter table error
Browse files Browse the repository at this point in the history
  • Loading branch information
JishLong committed May 16, 2023
1 parent 5c31bed commit 84a1a95
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -606,7 +606,8 @@ public static void write(Table table, Writer output) {
}
}
for (ForeignKey fk : table.getForeignKeys()) {
output.write("\t\t<foreign-key name=\"" + StringEscapeUtils.escapeXml10(fk.getName()) + "\" foreignTable=\""
String name = fk.getName() == null ? "" : fk.getName();
output.write("\t\t<foreign-key name=\"" + StringEscapeUtils.escapeXml10(name) + "\" foreignTable=\""
+ StringEscapeUtils.escapeXml10(fk.getForeignTableName()) + "\" foreignTableCatalog=\""
+ StringEscapeUtils.escapeXml10(fk.getForeignTableCatalog() == null || fk.getForeignTableCatalog().equals(table.getCatalog())
? ""
Expand Down

0 comments on commit 84a1a95

Please sign in to comment.