mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-23 20:13:21 +03:00
[fix] Nullable fields must have default values (#7522)
This commit is contained in:
parent
58cbcbfe70
commit
798722179e
@ -745,6 +745,15 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
|
||||
}
|
||||
}
|
||||
|
||||
if (!fieldMetadataInput.isNullable) {
|
||||
if (!fieldMetadataInput.defaultValue) {
|
||||
throw new FieldMetadataException(
|
||||
'Default value is required for non nullable fields',
|
||||
FieldMetadataExceptionCode.INVALID_FIELD_INPUT,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (fieldMetadataInput.options) {
|
||||
for (const option of fieldMetadataInput.options) {
|
||||
if (exceedsDatabaseIdentifierMaximumLength(option.value)) {
|
||||
|
Loading…
Reference in New Issue
Block a user