I need to ensure that the numbers inserted into a column are positive (i.e. greater than zero), but could not find a way to do it. Neither decimal
type's documentation nor Numeric type overview provide a solution (or a trick) that would allow me to set such a constraint on the database column.
I know there is the unsigned
modifier, but it only says that the value may not be negative (i.e. less than zero) and leaves zero as a valid value for unsigned columns.
Is there a way to enforce this on the database schema level? If not, I can trivially enforce the rule in the code, but I'd like to keep type information explicit in the schema.