#25694: Migrate command creates a default index for a CharField with a wrong
'_uniq' suffix in the name
----------------------------+------------------------------------
     Reporter:  synasius    |                    Owner:  nobody
         Type:  Bug         |                   Status:  new
    Component:  Migrations  |                  Version:  1.8
     Severity:  Normal      |               Resolution:
     Keywords:              |             Triage Stage:  Accepted
    Has patch:  1           |      Needs documentation:  0
  Needs tests:  0           |  Patch needs improvement:  1
Easy pickings:  0           |                    UI/UX:  0
----------------------------+------------------------------------

Comment (by jdufresne):

 > So, you're saying Django already dropps all indexes on a field. Good.
 That makes the proposal redundant.

 Yes, it drops all indexes when there is a change in field's `db_index`
 state. A link to the code:

 
https://github.com/django/django/blob/ca77b509059831b055a3b735ff77e042f8e1c0eb/django/db/backends/base/schema.py#L537-L544

 Notice it loops over all indexes, instead of looking them up by name. The
 comment "no strict check, as multiple indexes are possible" even suggests
 this is intentional.

 However, if there is no change to the field's state, the indexes will not
 be dropped/recreated. So upgrading to the next Django version will leave
 some of the old names with `_uniq` around until the field's state changes.
 This is why I proposed the "version" idea. That could be recognized as a
 change in state.

 With this new understanding, is no action acceptable? Can I unset "Patch
 needs improvement"? Or should I got ahead with the "version" proposal?

--
Ticket URL: <https://code.djangoproject.com/ticket/25694#comment:7>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.fd57cd36edbc03c3cc2a26c656567b1b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to