mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-12 20:30:25 +08:00
!110 feat: 支持各源数据库导出sql,数据库迁移部分bug修复
* feat: 各源数据库导出 * fix: 数据库迁移 bug修复
This commit is contained in:
@@ -197,14 +197,7 @@ func (pd *PgsqlDialect) ToColumn(commonColumn *dbi.Column) {
|
||||
commonColumn.CharMaxLength = 2000
|
||||
} else {
|
||||
commonColumn.DataType = dbi.ColumnDataType(ctype)
|
||||
// 哪些字段可以指定长度
|
||||
if !collx.ArrayAnyMatches([]string{"char", "time", "bit", "num", "decimal"}, ctype) {
|
||||
commonColumn.CharMaxLength = 0
|
||||
commonColumn.NumPrecision = 0
|
||||
} else if strings.Contains(strings.ToLower(ctype), "char") {
|
||||
// 如果类型是文本,长度翻倍
|
||||
commonColumn.CharMaxLength = commonColumn.CharMaxLength * 2
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user