Closed Jaymon closed 1 year ago
So instead of VARCHAR(256) I would do:
VARCHAR(256)
<COLNAME> TEXT NOT NULL CHECK (length(<COLNAME>) <= 256)
You can also easily modify the checks:
ALTER TABLE <TABLE NAME> ADD CONSTRAINT <CONSTRAINT-NAME> CHECK (length(<COLNAME>) <= 128)
This should work in both SQLite and Postgres. CHECK constraints can also be more involved like regexes and stuff
CHECK
So instead of
VARCHAR(256)
I would do:You can also easily modify the checks:
This should work in both SQLite and Postgres.
CHECK
constraints can also be more involved like regexes and stuffLinks
Search