mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-07-30 11:12:55 +08:00
support oracle table edit
This commit is contained in:
@ -125,7 +125,7 @@ public enum MysqlColumnTypeEnum implements ColumnBuilder {
|
||||
|
||||
|
||||
MysqlColumnTypeEnum(String dataTypeName, boolean supportLength, boolean supportScale, boolean supportNullable, boolean supportAutoIncrement, boolean supportCharset, boolean supportCollation, boolean supportComments, boolean supportDefaultValue, boolean supportExtent,boolean supportValue) {
|
||||
this.columnType = new ColumnType(dataTypeName, supportLength, supportScale, supportNullable, supportAutoIncrement, supportCharset, supportCollation, supportComments, supportDefaultValue, supportExtent,supportValue);
|
||||
this.columnType = new ColumnType(dataTypeName, supportLength, supportScale, supportNullable, supportAutoIncrement, supportCharset, supportCollation, supportComments, supportDefaultValue, supportExtent,supportValue,false);
|
||||
}
|
||||
|
||||
private static Map<String, MysqlColumnTypeEnum> COLUMN_TYPE_MAP = Maps.newHashMap();
|
||||
@ -227,6 +227,15 @@ public enum MysqlColumnTypeEnum implements ColumnBuilder {
|
||||
if(!type.getColumnType().isSupportDefaultValue() || StringUtils.isEmpty(column.getDefaultValue())){
|
||||
return "";
|
||||
}
|
||||
|
||||
if("EMPTY_STRING".equalsIgnoreCase(column.getDefaultValue().trim())){
|
||||
return StringUtils.join("DEFAULT ''");
|
||||
}
|
||||
|
||||
if("NULL".equalsIgnoreCase(column.getDefaultValue().trim())){
|
||||
return StringUtils.join("DEFAULT NULL");
|
||||
}
|
||||
|
||||
if(Arrays.asList(CHAR,VARCHAR,BINARY,VARBINARY, SET,ENUM).contains(type)){
|
||||
return StringUtils.join("DEFAULT '",column.getDefaultValue(),"'");
|
||||
}
|
||||
|
@ -106,6 +106,6 @@ public enum MysqlIndexTypeEnum {
|
||||
if (MysqlIndexTypeEnum.PRIMARY_KEY.getName().equals(tableIndex.getType())) {
|
||||
return StringUtils.join("DROP PRIMARY KEY");
|
||||
}
|
||||
return StringUtils.join("DROP INDEX `", tableIndex.getOldName());
|
||||
return StringUtils.join("DROP INDEX `", tableIndex.getOldName(),"`");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user