!110 feat: 支持各源数据库导出sql,数据库迁移部分bug修复

* feat: 各源数据库导出
* fix: 数据库迁移 bug修复
This commit is contained in:
zongyangleo
2024-03-26 09:05:28 +00:00
committed by Coder慌
parent 4b3ed1310d
commit 2acc295259
31 changed files with 821 additions and 424 deletions

View File

@@ -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
}
}
}