handle sparse, zerofill, unsigned, commant flags

This commit is contained in:
Jan Prochazka
2022-02-10 13:32:38 +01:00
parent 691bb0af4f
commit 0debe66dd0
11 changed files with 81 additions and 5 deletions

View File

@@ -15,7 +15,9 @@ function getColumnInfo({
numericScale,
defaultValue,
columnComment,
columnType,
}) {
const columnTypeTokens = _.isString(columnType) ? columnType.split(' ').map(x => x.trim().toLowerCase()) : [];
let fullDataType = dataType;
if (charMaxLength && isTypeString(dataType)) fullDataType = `${dataType}(${charMaxLength})`;
if (numericPrecision && numericScale && isTypeNumeric(dataType))
@@ -27,6 +29,8 @@ function getColumnInfo({
columnComment,
dataType: fullDataType,
defaultValue,
isUnsigned: columnTypeTokens.includes('unsigned'),
isZerofill: columnTypeTokens.includes('zerofill'),
};
}