diff --git a/dbswitch-common/src/main/java/com/gitee/dbswitch/common/type/ProductTypeEnum.java b/dbswitch-common/src/main/java/com/gitee/dbswitch/common/type/ProductTypeEnum.java index becd9a4b..e448a026 100644 --- a/dbswitch-common/src/main/java/com/gitee/dbswitch/common/type/ProductTypeEnum.java +++ b/dbswitch-common/src/main/java/com/gitee/dbswitch/common/type/ProductTypeEnum.java @@ -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; } /** diff --git a/dbswitch-core/src/main/java/com/gitee/dbswitch/util/GenerateSqlUtils.java b/dbswitch-core/src/main/java/com/gitee/dbswitch/util/GenerateSqlUtils.java index a5ebc2c0..f464d2ee 100644 --- a/dbswitch-core/src/main/java/com/gitee/dbswitch/util/GenerateSqlUtils.java +++ b/dbswitch-core/src/main/java/com/gitee/dbswitch/util/GenerateSqlUtils.java @@ -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("'", "\\'")));