ソースを参照

[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
Luis Daniel Lucio Quiroz 6 年 前
コミット
ff6d3ac1bb
1 ファイル変更5 行追加0 行削除
  1. 5 0
      resources/classes/schema.php

+ 5 - 0
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'])) {