declared-column-bounds
Encode explicitly declared numeric and interval ranges in SQL CHECK constraints.
Why
A column comment declaring a range does not reject out-of-range writes. Encoding that explicit contract in CHECK constraints keeps every writer subject to the same bounds.
Fix
Replace the range comment with an inline CHECK that enforces the declared bounds. Preserve units, inclusive endpoints and nullability. Do not invent a positive bound from a column name.
Examples
CREATE TABLE retry ( attempts INTEGER NOT NULL -- required; capped 1..10);CREATE TABLE retry ( attempts INTEGER NOT NULL CHECK (attempts BETWEEN 1 AND 10));