Important: #105441 - TCA select fields with null item values create nullable columns
See forge#105441
Description
When configuring a TCA select field with render
and adding an item with 'value' => null, the generated database column is
now nullable regardless of whether the other item values are integers or strings.
Previously, the following configuration with integer item values would incorrectly
generate a
VARCHAR column:
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'some_table',
'default' => null,
'items' => [
['label' => 'Please choose', 'value' => null],
],
],
Copied!
This now correctly generates
INT UNSIGNED DEFAULT NULL.
Similarly, a configuration with string item values now also generates a nullable column:
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'default' => null,
'items' => [
['label' => 'Default', 'value' => null],
['label' => 'Option', 'value' => 'some_value'],
],
],
Copied!
This now correctly generates
VARCHAR instead of
VARCHAR.