diff options
author | William Desportes <williamdes@wdes.fr> | 2022-10-19 16:22:13 +0300 |
---|---|---|
committer | William Desportes <williamdes@wdes.fr> | 2022-10-19 16:23:23 +0300 |
commit | 0729fb35978315312666d8250fbc7246be2674a0 (patch) | |
tree | 585bc134c3b81ee5742d49e7c0c9b4e20723353f /js | |
parent | 913a2e7ff3c33d6705c43eb1c52d23fe91531069 (diff) |
Fix importing a column from the central column list on structure add column - default value
The default value was not properly set nor was the field_default_type select
Signed-off-by: William Desportes <williamdes@wdes.fr>
Diffstat (limited to 'js')
-rw-r--r-- | js/src/functions.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/js/src/functions.js b/js/src/functions.js index 5398903612..a1289bc968 100644 --- a/js/src/functions.js +++ b/js/src/functions.js @@ -2969,13 +2969,19 @@ Functions.autoPopulate = function (inputId, offset) { } var colDefault = centralColumnList[db + '_' + table][offset].col_default.toUpperCase(); var $input4 = $('#' + newInputId + '4'); - if (colDefault !== '' && colDefault !== 'NULL' && colDefault !== 'CURRENT_TIMESTAMP' && colDefault !== 'CURRENT_TIMESTAMP()') { + if (colDefault === 'NULL' || colDefault === 'CURRENT_TIMESTAMP' || colDefault === 'CURRENT_TIMESTAMP()') { + if (colDefault === 'CURRENT_TIMESTAMP()') { + colDefault = 'CURRENT_TIMESTAMP'; + } + $input4.val(colDefault); + $input4.siblings('.default_value').hide(); + } if (colDefault === '') { + $input4.val('NONE'); + $input4.siblings('.default_value').hide(); + } else { $input4.val('USER_DEFINED'); $input4.siblings('.default_value').show(); $input4.siblings('.default_value').val(centralColumnList[db + '_' + table][offset].col_default); - } else { - $input4.val(centralColumnList[db + '_' + table][offset].col_default); - $input4.siblings('.default_value').hide(); } $('#' + newInputId + '5').val(centralColumnList[db + '_' + table][offset].col_collation); var $input6 = $('#' + newInputId + '6'); |