fixed mssql defaults

This commit is contained in:
Jan Prochazka
2024-10-29 16:07:51 +01:00
parent 7deeb78d69
commit d661b9f6a4
2 changed files with 11 additions and 2 deletions

View File

@@ -51,6 +51,15 @@ function getColumnInfo({
if (numericPrecision && numericScale && isTypeNumeric(dataType)) {
fullDataType = `${dataType}(${numericPrecision},${numericScale})`;
}
if (defaultValue) {
defaultValue = defaultValue.trim();
while (defaultValue.startsWith('(') && defaultValue.endsWith(')')) {
defaultValue = defaultValue.slice(1, -1);
defaultValue = defaultValue.trim();
}
}
return {
columnName,
dataType: fullDataType,