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