mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-01-03 21:26:35 +08:00
!110 feat: 支持各源数据库导出sql,数据库迁移部分bug修复
* feat: 各源数据库导出 * fix: 数据库迁移 bug修复
This commit is contained in:
@@ -178,17 +178,7 @@ func (od *OracleDialect) ToColumn(commonColumn *dbi.Column) {
|
||||
commonColumn.CharMaxLength = 2000
|
||||
} else {
|
||||
commonColumn.DataType = dbi.ColumnDataType(ctype)
|
||||
// 如果类型是数字,类型后不需要带长度
|
||||
if strings.Contains(strings.ToLower(ctype), "int") {
|
||||
commonColumn.CharMaxLength = 0
|
||||
commonColumn.NumPrecision = 0
|
||||
} else if strings.Contains(strings.ToLower(ctype), "char") {
|
||||
// 如果是字符串类型,长度最大4000,否则修改字段类型为clob
|
||||
if commonColumn.CharMaxLength > 4000 {
|
||||
commonColumn.DataType = "CLOB"
|
||||
commonColumn.CharMaxLength = 0
|
||||
}
|
||||
}
|
||||
od.dc.GetMetaData().FixColumn(commonColumn)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user