Merge branch 'master' of github.com:dbgate/dbgate

This commit is contained in:
Jan Prochazka 2022-04-21 10:04:50 +02:00
commit 82304f13e7

View File

@ -36,9 +36,12 @@ function getColumnInfo({
defaultConstraint,
}) {
let fullDataType = dataType;
if (charMaxLength && isTypeString(dataType)) fullDataType = `${dataType}(${charMaxLength})`;
if (numericPrecision && numericScale && isTypeNumeric(dataType))
if (charMaxLength && isTypeString(dataType)) {
fullDataType = `${dataType}(${charMaxLength < 0 ? 'MAX' : charMaxLength})`;
}
if (numericPrecision && numericScale && isTypeNumeric(dataType)) {
fullDataType = `${dataType}(${numericPrecision},${numericScale})`;
}
return {
columnName,
dataType: fullDataType,