alter processor - works add column tests

This commit is contained in:
Jan Prochazka
2021-07-01 09:12:15 +02:00
parent 4a3ef70979
commit 3791fd568c
4 changed files with 14 additions and 4 deletions

View File

@@ -25,11 +25,13 @@ function getColumnInfo({
if (char_max_length && isTypeString(normDataType)) fullDataType = `${normDataType}(${char_max_length})`;
if (numeric_precision && numeric_ccale && isTypeNumeric(normDataType))
fullDataType = `${normDataType}(${numeric_precision},${numeric_ccale})`;
const autoIncrement = !!(default_value && default_value.startsWith('nextval('));
return {
columnName: column_name,
dataType: fullDataType,
notNull: !is_nullable || is_nullable == 'NO' || is_nullable == 'no',
defaultValue: default_value,
defaultValue: autoIncrement ? undefined : default_value,
autoIncrement,
};
}