We usually use autoincrement columns to add identifiers to table rows. Those values are generated as positive integers by mysql.
When I want to model a relation between two tables I use columns of type unsigned int
to store the foreign keys. unsigned int
s can store int values including 0
. As 0
is not a valid value for relations I would like to disallow those values.
Question: Is there any way to define a column that can only hold positive integers > 0?