#35759: Don't require max_length on CharField on SQLite backend
-------------------------------------+-------------------------------------
Reporter: Curtis Maloney | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):
* stage: Unreviewed => Accepted
Comment:
SQLite doesn't enforce any database constraints when a max length is
specified (see #21471 and [
https://forum.djangoproject.com/t/idea-make-
sqlite-enforce-varchar-lengths-via-check-constraints/33101 this recent
forum discussion on the subject]) so supporting `max_length=None` on
SQLite is trivial (we already implicitly do).
For anyone interested in picking this up the patch needs three things
1. The SQLite backend's `supports_unlimited_charfield` feature flag must
be set to true.
2. The `CharField`documentation must be adjusted to mention
[
https://github.com/django/django/blob/16af0c60ed90813ed70ecef4e64a89301ed0f0a2/docs/ref/models/fields.txt#L723
the feature is available of SQLite as well] with a `::versionchanged`.
3. A release note must be added.
--
Ticket URL: <
https://code.djangoproject.com/ticket/35759#comment:2>