#10164: AutoField is broken for sqlite backend
-------------------------------------+-------------------------------------
Reporter: malte | Owner: nobody
Type: Bug | Status: new
Milestone: 1.4 | Component: Database layer
Version: 1.2 | (models, ORM)
Resolution: | Severity: Normal
Triage Stage: Accepted | Keywords: sqlite
Needs documentation: 1 | autoincrement
Patch needs improvement: 1 | Has patch: 1
| Needs tests: 1
| Easy pickings: 0
-------------------------------------+-------------------------------------
Changes (by lukeplant):
* needs_docs: 0 => 1
* needs_tests: 0 => 1
* easy: => 0
Comment:
This still needs tests (sorry for not setting the flag before).
I'm still bothered by the creation of a new method on Field to cope with
one peculiarity of a single backend, i.e. the need for the autoincrement
keyword and the fact that it only allows this keyword at the end, not at
the beginning. But I can't see a nicer way of doing it. As to the current
patch:
In Field.db_type_suffix, I don't see any need for using the string
interpolation using the dictionary. Since we have no use case for that, it
would be better to remove it.
We should put db_types_suffix as an empty dictionary on
`BaseDatabaseCreation`, and adjust the error handling in
Field.db_type_suffix accordingly i.e. so it only catches `KeyError`.
We also need some docs - a note in the release notes, for the following
reasons:
1) It could potentially cause breakage.
2) The change will require a manual migration for anyone using SQLite in
production, if they care about the change. Unfortunately there is no way
to do an 'alter column' in SQLite, so this migration is non-trivial.
Many thanks.
--
Ticket URL: <http://code.djangoproject.com/ticket/10164#comment:19>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.