修复Gbase8a建表语句报错

This commit is contained in:
wewelove88
2024-02-19 15:21:54 +08:00
parent b2e0228406
commit b24409f314
2 changed files with 16 additions and 2 deletions

View File

@@ -235,7 +235,16 @@ public enum ProductTypeEnum {
* @return boolean
*/
public boolean isLikeMysql() {
return this == MYSQL || this == MARIADB || this == GBASE8A;
return this == MYSQL || this == MARIADB;
}
/**
* 类似于MySQL系列的数据库类型
*
* @return boolean
*/
public boolean isLikeGbase8a() {
return this == GBASE8A;
}
/**

View File

@@ -99,7 +99,12 @@ public final class GenerateSqlUtils {
}
sb.append(")");
if (type.isLikeMysql()) {
if (type.isLikeGbase8a()) {
sb.append("ENGINE=EXPRESS DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin");
if (withRemarks && StringUtils.isNotBlank(tableRemarks)) {
sb.append(String.format(" COMMENT='%s' ", tableRemarks.replace("'", "\\'")));
}
} else if (type.isLikeMysql()) {
sb.append("ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin");
if (withRemarks && StringUtils.isNotBlank(tableRemarks)) {
sb.append(String.format(" COMMENT='%s' ", tableRemarks.replace("'", "\\'")));