mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 18:06:01 +00:00
alter processor - works add column tests
This commit is contained in:
@@ -21,7 +21,7 @@ function getColumnInfo({
|
||||
fullDataType = `${dataType}(${numericPrecision},${numericScale})`;
|
||||
return {
|
||||
notNull: !isNullable || isNullable == 'NO' || isNullable == 'no',
|
||||
autoIncrement: extra && extra.toLowerCase().includes('auto_increment'),
|
||||
autoIncrement: !!(extra && extra.toLowerCase().includes('auto_increment')),
|
||||
columnName,
|
||||
dataType: fullDataType,
|
||||
defaultValue,
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user