#26034: Altering CharFields to have both db_index=True and unique=True crashes
on
postgresql
----------------------------------------------+--------------------
Reporter: kaedroho | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.9
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
Hi Everyone,
If you have a CharField with db_index=True and alter it to have both
"db_index=True" and "unique=True" the migration for this will not run on
PostgreSQL.
Instead, you will get the following error:
django.db.utils.ProgrammingError: relation
"app_mymodel_my_field_3922656f_like" already exists
This bug apears to have been introduced in Django 1.8.7/1.9.1. Git bisect
leads to this commit:
https://github.com/django/django/commit/722fae4b5159b2810e252e3385936f86f04eb09b
I have created a test project that should hopefully help diagnosis:
https://github.com/kaedroho/djangobugtest2/
Thanks,
Karl
--
Ticket URL: <https://code.djangoproject.com/ticket/26034>
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/051.130bb16306353ad5126d7bc95ecddec4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.