update to fix PR

This commit is contained in:
lmarcouiller
2022-02-22 16:35:10 +01:00
parent 192e62fa5c
commit edbf1bb34b

View File

@@ -311,7 +311,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
if ($key == 'entity') {
$texttoinsert .= ' DEFAULT 1';
} else {
if (!empty($val['default']) && $val['default'] != '') {
if (!empty($val['default'])) {
if (preg_match('/^null$/i', $val['default'])) {
$texttoinsert .= " DEFAULT NULL";
} elseif (preg_match('/varchar/', $type)) {