mirror of
https://gitee.com/dromara/dbswitch.git
synced 2025-09-09 21:49:08 +00:00
[fix]Postgresql字符串字段非主键及有长度的情况下转换为varchar类型
This commit is contained in:
@@ -209,11 +209,11 @@ public class PostgresMetadataQueryProvider extends AbstractMetadataProvider {
|
|||||||
if (null != pks && !pks.isEmpty() && pks.contains(fieldname)) {
|
if (null != pks && !pks.isEmpty() && pks.contains(fieldname)) {
|
||||||
retval += "VARCHAR(" + length + ")";
|
retval += "VARCHAR(" + length + ")";
|
||||||
} else {
|
} else {
|
||||||
retval += "TEXT";
|
retval += "VARCHAR(" + length + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (v.isHaveDefault()) {
|
if (v.isHaveDefault()) {
|
||||||
retval += " DEFAULT " + v.getDefaultValue();
|
retval += " DEFAULT " + "'" + v.getDefaultValue() + "'";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ColumnMetaData.TYPE_BINARY:
|
case ColumnMetaData.TYPE_BINARY:
|
||||||
|
Reference in New Issue
Block a user