]> git.mxchange.org Git - friendica.git/commitdiff
Generate field_list only when needed
authorAlexandre Alapetite <alexandre@alapetite.fr>
Sun, 7 May 2017 09:07:34 +0000 (11:07 +0200)
committerAlexandre Alapetite <alexandre@alapetite.fr>
Sun, 7 May 2017 09:07:34 +0000 (11:07 +0200)
https://github.com/friendica/friendica/pull/3442/files#r115137722

include/dbstructure.php

index 7fcec33a68c2277ec7f7d24a8461e02235971a26..c01c558c61e2c488cbda53186b3d48d3d5de0beb 100644 (file)
@@ -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) {