From 88225282273e0d7c0d933d8cb3e2ca6761feedad Mon Sep 17 00:00:00 2001 From: Luis Daniel Lucio Quiroz Date: Wed, 8 May 2019 16:02:20 -0400 Subject: [PATCH] [4.5] Fix the ALTER TABLE (#4097) * Fix the ALTER TABLE when $apps[$x]['db'][$y]['fields'][$z]['name'] is an array, you dont try to get the ['text'] index therefore fields such as v_xml_cdr.xml_uuid, v_destinations.destination_type and v_destinations.destination_number wont be created when upgrading. This patch fixes it * Update schema.php --- resources/classes/schema.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/classes/schema.php b/resources/classes/schema.php index 483366c081..00f1921fc1 100644 --- a/resources/classes/schema.php +++ b/resources/classes/schema.php @@ -648,6 +648,11 @@ if (!class_exists('schema')) { $sql_update .= "ALTER TABLE ".$table_name." ADD ".$field['name']." ".$field_type.";\n"; } } + else { + if ($field['exists'] == "false") { + $sql_update .= "ALTER TABLE ".$table_name." ADD ".$field['name']["text"]." ".$field_type.";\n"; + } + } } //rename fields where the name has changed if (is_array($field['name'])) {