fix: wrong detection of field default expressions in some cases

This commit is contained in:
Fabio Di Stasio 2021-05-25 16:54:13 +02:00
parent c568acae14
commit 04bdd085a5
1 changed files with 2 additions and 2 deletions

View File

@ -239,11 +239,11 @@ export default {
field.defaultType = 'noval';
else if (field.default === 'NULL')
field.defaultType = 'null';
else if (field.default.match(/^\s*(\w+)\s*\((.*)\)$/))
else if (isNaN(+field.default) && field.default.charAt(0) !== '\'')
field.defaultType = 'expression';
else {
field.defaultType = 'custom';
if (isNaN(field.default) && !field.default.includes('\''))
if (isNaN(+field.default) && !field.default.includes('\''))
field.default = `'${field.default}'`;
}