class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> {
@Attribute(DataTypes.STRING)
@AllowNull
declare firstName: string | null;
}
Makes the attribute accept null values. Opposite of NotNull.
It is a shortcut for setting the allowNull
option of the Attribute decorator to true.
class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> {
@Attribute(DataTypes.STRING)
@AllowNull
declare firstName: string | null;
}
Makes the attribute accept null values. Opposite of NotNull.
It is a shortcut for setting the allowNull
option of the Attribute decorator to true.
Optional
propertyDescriptor: PropertyDescriptorclass User extends Model<InferAttributes<User>, InferCreationAttributes<User>> {
@Attribute(DataTypes.STRING)
@AllowNull
declare firstName: string | null;
}
Makes the attribute accept null values. Opposite of NotNull. It is a shortcut for setting the
allowNull
option of the Attribute decorator to true.