mirror of
https://github.com/lingble/twenty.git
synced 2025-11-02 05:37:56 +00:00
[fix] Nullable fields must have default values (#7522)
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user