From a7c9461cc09f57744b78084d07eddee6d33441b2 Mon Sep 17 00:00:00 2001 From: chenos Date: Sun, 13 Dec 2020 17:16:54 +0800 Subject: [PATCH] fix: remove required parameter from the field options --- packages/database/src/fields/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/database/src/fields/index.ts b/packages/database/src/fields/index.ts index 60d45b777..1de6dd58e 100644 --- a/packages/database/src/fields/index.ts +++ b/packages/database/src/fields/index.ts @@ -95,14 +95,11 @@ export function getDataTypeKey(type: any): string { * @param context */ export function buildField(options: FieldOptions, context: Fields.FieldContext) { - let { type, required } = options; + let { type } = options; if (type instanceof ABSTRACT) { options = {...type.options, ...options}; } type = getDataTypeKey(type); - if (type !== 'VIRTUAL' && required) { - options.allowNull = false; - } const Field = getField(type); return new Field({type, ...options}, context); }