Merge #18007 - Fix #18006 - UUID columns can't be moved

Pull-request: #18007
Fixes: #18006

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2023-01-08 18:04:35 +04:00
commit 542a96359f
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889

View File

@ -81,11 +81,17 @@ final class MoveColumnsController extends AbstractController
$timeDefault = $data['Default'] === 'CURRENT_TIMESTAMP' || $data['Default'] === 'current_timestamp()';
$current_timestamp = $timeType && $timeDefault;
$uuidType = $data['Type'] === 'uuid';
$uuidDefault = $data['Default'] === 'UUID' || $data['Default'] === 'uuid()';
$uuid = $uuidType && $uuidDefault;
// @see https://mariadb.com/kb/en/library/information-schema-columns-table/#examples
if ($data['Null'] === 'YES' && in_array($data['Default'], [$defaultNullValue, null])) {
$default_type = 'NULL';
} elseif ($current_timestamp) {
$default_type = 'CURRENT_TIMESTAMP';
} elseif ($uuid) {
$default_type = 'UUID';
} elseif ($data['Default'] === null) {
$default_type = 'NONE';
} else {