#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):
> How do you suggest to take care of existing indexes that would now need
to be renamed?
Is this a required component of this bug fix?
With the current implementation, migrations don't actually care about the
name of the index. It is just for human aesthetics. When removing an
index, Django will remove all non-unique indexes regardless of the name. I
actually bumped into this while working on another ticket and thought it
would be a quick fix.
If this is required, maybe there could be something like
`Field.index_name_version` that could be inspected during migrations. If
the version has changed, drop and recreate indexes. Then in the upgrade
docs, recommend people run `makemigrations` after updating. Thoughts on
this approach?
--
Ticket URL: <https://code.djangoproject.com/ticket/25694#comment:5>
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.c7ffea6a70763c36a4f0e342031ebaea%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.