Skip to content

Commit

Permalink
Copy code manually code to close #32423 without the syntax error.
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Dec 23, 2024
1 parent b21b4e8 commit 5f06584
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion htdocs/core/lib/modulebuilder.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down

0 comments on commit 5f06584

Please sign in to comment.