From 354531bfa6a4dab76c87b08689141056d6f439cf Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 7 May 2017 11:07:34 +0200 Subject: [PATCH] Generate field_list only when needed https://github.com/friendica/friendica/pull/3442/files#r115137722 --- include/dbstructure.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/dbstructure.php b/include/dbstructure.php index 7fcec33a68..c01c558c61 100644 --- a/include/dbstructure.php +++ b/include/dbstructure.php @@ -399,11 +399,13 @@ function update_structure($verbose, $action, $tables=null, $definition=null) { } $field_list = ''; - foreach ($structure['fields'] AS $fieldname => $parameters) { - $field_list .= 'ANY_VALUE(`' . $fieldname . '`),'; + if ($is_unique && $ignore == '') { + foreach ($structure['fields'] AS $fieldname => $parameters) { + $field_list .= 'ANY_VALUE(`' . $fieldname . '`),'; + } + $field_list = rtrim($field_list, ','); } - $field_list = rtrim($field_list, ','); - + if ($verbose) { // Ensure index conversion to unique removes duplicates if ($is_unique) { -- 2.39.5