Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
shanhexi committed Oct 17, 2023
2 parents b62b421 + 2728259 commit 16f952f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ public String buildModifyTaleSql(Table oldTable, Table newTable) {
script.append("\t").append(mysqlIndexTypeEnum.buildModifyIndex(tableIndex)).append(",\n");
}
}

script = new StringBuilder(script.substring(0, script.length() - 2));
script.append(";");
if(script.length()>2) {
script = new StringBuilder(script.substring(0, script.length() - 2));
script.append(";");
}

return script.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public String buildModifyTaleSql(Table oldTable, Table newTable) {

if (!StringUtils.equalsIgnoreCase(oldTable.getName(), newTable.getName())) {
script.append("ALTER TABLE "). append("\"").append(oldTable.getSchemaName()).append("\".\"").append(oldTable.getName()).append("\"");
script.append(" ").append("RENAME TO ").append("\"").append(newTable.getName()).append("\"").append(";");
script.append(" ").append("RENAME TO ").append("\"").append(newTable.getName()).append("\"").append(";\n");
}
if (!StringUtils.equalsIgnoreCase(oldTable.getComment(), newTable.getComment())) {
script.append("\n").append(buildTableComment(newTable)).append(";");
script.append("").append(buildTableComment(newTable)).append(";\n");
}


Expand All @@ -92,9 +92,10 @@ public String buildModifyTaleSql(Table oldTable, Table newTable) {
script.append("\t").append(mysqlIndexTypeEnum.buildModifyIndex(tableIndex)).append(";\n");
}
}

script = new StringBuilder(script.substring(0, script.length() - 2));
script.append(";");
if(script.length()>2) {
script = new StringBuilder(script.substring(0, script.length() - 2));
script.append(";");
}

return script.toString();
}
Expand Down

0 comments on commit 16f952f

Please sign in to comment.