[Django] #33488: Django rename migration does not rename the index

31 views
Skip to first unread message

Django

unread,
Feb 3, 2022, 8:04:23 AM2/3/22
to django-...@googlegroups.com
#33488: Django rename migration does not rename the index
-------------------------------------+-------------------------------------
Reporter: Jef D | Owner: nobody
Type: Bug | Status: new
Component: | Version: 4.0
Migrations | Keywords: migration,
Severity: Normal | postgresql
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I tried to do a rename migration followed by a new field migration. This
new field had the same name as the old field which was renamed.

The second migration failed on Postgres (not on SQLite). After an
inspection it appears that the rename migration left the old index in
place which made the new field migration fail.

Full details in this StackOverflow post:
https://stackoverflow.com/questions/70970039/django-rename-field-and-
create-new-one-with-the-same-name-returns-psycopg2-error/70971693#70971693

I don't know Django migrations well enough to judge if this is a Django
issue or an psycopg issue. Since it occured in Django I will try this one
first.

The current workaround is to manually drop or rename the old index.

--
Ticket URL: <https://code.djangoproject.com/ticket/33488>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 3, 2022, 1:43:55 PM2/3/22
to django-...@googlegroups.com
#33488: Django rename migration does not rename the index
-------------------------------------+-------------------------------------
Reporter: Jef D | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 4.0
Severity: Normal | Resolution: duplicate
Keywords: migration, | Triage Stage:
postgresql | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* status: new => closed
* resolution: => duplicate


Comment:

Duplicate of #23577.

--
Ticket URL: <https://code.djangoproject.com/ticket/33488#comment:1>

Reply all
Reply to author
Forward
0 new messages