[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) {
|
if (fieldMetadataInput.options) {
|
||||||
for (const option of fieldMetadataInput.options) {
|
for (const option of fieldMetadataInput.options) {
|
||||||
if (exceedsDatabaseIdentifierMaximumLength(option.value)) {
|
if (exceedsDatabaseIdentifierMaximumLength(option.value)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user