1
1
mirror of https://github.com/Fabio286/antares.git synced 2024-12-25 08:20:39 +01:00

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

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}'`;
}