I’ve just been bitten by issues migrating from sqlite to postgres. It turns out sqlite doesn’t enforce varchar constraints while postgres does. So now I have to repeat all the testing I’ve done for my app to see where it dies due to data being too long
ChatGPT says a CHECK constraint can be added in SQLite to enforce varchar limits:
The additional inline constraints is an approach that we take with PositiveIntegerField and friends on backends that don’t support unsigned integer types.
But the main concerns here are backward compatiblity. SQLite tables that were created before this change and might have invalid data crept in and be prevented from being altered (most SQLite table alterations require a full table rebuild).
Given that SQLite support arbitrary length VARCHAR (they are just TEXT after all) and that we managed to enable foreign keys in past versions without causing too much trouble I think this change could be accepted.
The process is usually to use the original ticket.
I’ve just posted a message on Discord to see if anyone has any concerns & wants to vote. Might be a good idea to wait a day or 2 before committing to any work?