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