Copy code manually code to close #32423 without the syntax error.

This commit is contained in:
Laurent Destailleur (aka Eldy)
2024-12-24 00:56:22 +01:00
parent ba7ba6f37f
commit af6fc96d77

View File

@@ -411,7 +411,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
foreach ($object->fields as $key => $val) {
$i++;
if (!empty($val['index'])) {
$texttoinsert .= "ALTER TABLE llx_".strtolower($module).'_'.strtolower($objectname)." ADD INDEX idx_".strtolower($module).'_'.strtolower($objectname)."_".$key." (".$key.");";
$texttoinsert .= "ALTER TABLE llx_".strtolower($module).'_'.strtolower($objectname)." ADD ".($key == 'ref' ? "UNIQUE INDEX uk_" : "INDEX idx_").strtolower($module).'_'.strtolower($objectname)."_".$key." (".$key.($key == 'ref' && array_key_exists('entity', $object->fields) ? ", entity" : "").");";
$texttoinsert .= "\n";
}
if (!empty($val['foreignkey'])) {