[ISSUE-17793] Revert previous change + Fix default selection of uuid in alter table
Signed-off-by: Mo Sureerat <sureemo@gmail.com>
This commit is contained in:
parent
f8bee4cd5d
commit
ddf928e6f3
@ -1109,14 +1109,7 @@ class InsertEdit
|
||||
private function getSpecialCharsAndBackupFieldForInsertingMode(
|
||||
array $column
|
||||
) {
|
||||
$isNullableUUID = ! empty($column['True_Type'])
|
||||
&& ! empty($column['Default'])
|
||||
&& ! empty($column['Null'])
|
||||
&& $column['True_Type'] === 'uuid'
|
||||
&& $column['Default'] === 'uuid()'
|
||||
&& $column['Null'] === 'YES';
|
||||
|
||||
if ($isNullableUUID || (! isset($column['Default']))) {
|
||||
if (! isset($column['Default'])) {
|
||||
$column['Default'] = '';
|
||||
$realNullValue = true;
|
||||
$data = '';
|
||||
|
||||
@ -243,6 +243,8 @@ final class ColumnsDefinition
|
||||
case 'NULL':
|
||||
case 'CURRENT_TIMESTAMP':
|
||||
case 'current_timestamp()':
|
||||
case 'UUID':
|
||||
case 'uuid()':
|
||||
$columnMeta['Default'] = $columnMeta['DefaultType'];
|
||||
break;
|
||||
}
|
||||
@ -300,6 +302,11 @@ final class ColumnsDefinition
|
||||
$columnMeta['DefaultType'] = 'CURRENT_TIMESTAMP';
|
||||
$columnMeta['DefaultValue'] = '';
|
||||
break;
|
||||
case 'UUID':
|
||||
case 'uuid()':
|
||||
$columnMeta['DefaultType'] = 'UUID';
|
||||
$columnMeta['DefaultValue'] = '';
|
||||
break;
|
||||
default:
|
||||
$columnMeta['DefaultType'] = 'USER_DEFINED';
|
||||
$columnMeta['DefaultValue'] = $columnMeta['Default'];
|
||||
|
||||
@ -1801,34 +1801,6 @@ class InsertEditTest extends AbstractTestCase
|
||||
'hello world<br><b>lorem</b> ipsem',
|
||||
],
|
||||
],
|
||||
'uuid with nullable' => [
|
||||
[
|
||||
'True_Type' => 'uuid',
|
||||
'Default' => 'uuid()',
|
||||
'Null' => 'YES',
|
||||
],
|
||||
[
|
||||
true,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
],
|
||||
],
|
||||
'uuid with not nullable' => [
|
||||
[
|
||||
'True_Type' => 'uuid',
|
||||
'Default' => 'uuid()',
|
||||
'Null' => 'NO',
|
||||
],
|
||||
[
|
||||
false,
|
||||
'uuid()',
|
||||
'uuid()',
|
||||
'',
|
||||
'uuid()',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user