Eg: `ALTER TABLE users ADD CONSTRAINT username_max_len CHECK LENGTH(username) <= 100 NOT VALID;`
The NOT_VALID option skips checking the existing data, so the migration is quasi-instant.
That way the constraint can easily be swapped out by removing the old one and adding a new one, and you have maximum flexibility going forward.
This also doesn't require an index rebuild, and better models what's actually happening internally.