#14651: ignored field index creation for fields with unique=True and
db_index=True
---------------------------------------------------+------------------------
Reporter: jordi | Owner: nobody
Status: closed | Milestone:
Component: Database layer (models, ORM) | Version: 1.2
Resolution: invalid | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Comment (by jordi):
In the case
field = models.CharField?(max_length=4, unique=True, db_index=True)
I just need a quick access to this field, and it must be a unique. If the
field is part of an other index I think it not the matter.
In the code, creation of indexes with (unique=True and db_index=True) are
just ignored:
http://code.djangoproject.com/browser/django/trunk/django/db/backends/creation.py#L260
If there is a reason, the user should be warned and it should be stated in
the documentation http://docs.djangoproject.com/en/1.2/ref/models/fields
/#common-model-field-options
That's all, thanks.
--
Ticket URL: <http://code.djangoproject.com/ticket/14651#comment:2>
Django <http://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.