diff --git a/Sources/Db/APIs/MySQL.php b/Sources/Db/APIs/MySQL.php index 8db1a0f530c..6b76a7a2ead 100644 --- a/Sources/Db/APIs/MySQL.php +++ b/Sources/Db/APIs/MySQL.php @@ -1348,10 +1348,12 @@ public function calculate_type(string $type_name, ?int $type_size = null, bool $ if (!$reverse) { $types = [ 'inet' => 'varbinary', + 'uuid' => 'binary', ]; } else { $types = [ 'varbinary' => 'inet', + 'binary' => 'uuid', ]; } @@ -1360,11 +1362,19 @@ public function calculate_type(string $type_name, ?int $type_size = null, bool $ if ($type_name == 'inet' && !$reverse) { $type_size = 16; $type_name = 'varbinary'; + } elseif ($type_name == 'uuid' && !$reverse) { + $type_size = 16; + $type_name = 'binary'; } elseif ($type_name == 'varbinary' && $reverse && $type_size == 16) { $type_name = 'inet'; $type_size = null; + } elseif ($type_name == 'binary' && $reverse && $type_size == 16) { + $type_name = 'uuid'; + $type_size = null; } elseif ($type_name == 'varbinary') { $type_name = 'varbinary'; + } elseif ($type_name == 'binary') { + $type_name = 'binary'; } else { $type_name = $types[$type_name]; } @@ -1629,8 +1639,6 @@ public function create_table(string $table_name, array $columns, array $indexes ], ); - return $result; - // Fill the old data if ($old_table_exists) { $same_col = [];