Fix the software_uuid issue for upgrade schema

This commit is contained in:
Mark Crane
2014-07-06 01:22:33 +00:00
parent eef6a1f801
commit bf68a4bf0c
2 changed files with 2 additions and 2 deletions

View File

@@ -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)";

View File

@@ -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";