Эх сурвалжийг харах

Fix the software_uuid issue for upgrade schema

Mark Crane 11 жил өмнө
parent
commit
7d710d2f50

+ 1 - 1
core/upgrade/app_config.php

@@ -52,7 +52,7 @@
 		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
 		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = "true";
 		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "software_uuid";
+		$apps[$x]['db'][$y]['fields'][$z]['name'] = "software_uuid";
 		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
 		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
 		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";

+ 1 - 1
resources/schema.php

@@ -438,7 +438,7 @@ function db_upgrade_schema ($db, $db_type, $db_name, $display_results) {
 										$db_field_type = db_column_data_type ($db, $db_type, $db_name, $table_name, $field_name);
 										$field_type_array = explode("(", $field_type);
 										$field_type = $field_type_array[0];
-										if (trim($db_field_type) != trim($field_type)) {
+										if (trim($db_field_type) != trim($field_type) && strlen($db_field_type) > 0) {
 											if ($db_type == "pgsql") {
 												if (strtolower($field_type) == "uuid") {
 													$sql_update .= "ALTER TABLE ".$table_name." ALTER COLUMN ".$field_name." TYPE uuid USING\n";