--
Ticket URL: <https://code.djangoproject.com/ticket/33710>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => David Wobrock
* status: new => assigned
Comment:
I understand the issue that arises when one reverses a `RenameIndex`, but
it was made "on purpose" somehow.
In https://code.djangoproject.com/ticket/27064,
> For backwards operations with unnamed old indexes, RenameIndex is a
noop.
From my understanding, when an unnamed index becomes "named", the idea was
that it remained "named" even when reversing the operation.
I guess the implementation is not entirely correct, since it doesn't allow
idempotency of the operation when applying/un-applying it.
I'll try to find a fix
--
Ticket URL: <https://code.djangoproject.com/ticket/33710#comment:1>
Comment (by Mariusz Felisiak):
Replying to [comment:1 David Wobrock]:
> I understand the issue that arises when one reverses a `RenameIndex`,
but it was made "on purpose" somehow.
> In https://code.djangoproject.com/ticket/27064,
> > For backwards operations with unnamed old indexes, RenameIndex is a
noop.
>
> From my understanding, when an unnamed index becomes "named", the idea
was that it remained "named" even when reversing the operation.
Yes, sorry, I should predict that this is going to cause naming issues.
> I guess the implementation is not entirely correct, since it doesn't
allow idempotency of the operation when applying/un-applying it.
>
> I'll try to find a fix
We should be able to find the old name with
`SchemaEditor._create_index_name()`.
--
Ticket URL: <https://code.djangoproject.com/ticket/33710#comment:2>
Comment (by David Wobrock):
I think making the database operation a noop when the old index has the
same name as the new index name can be enough.
Here is a first draft https://github.com/django/django/pull/15695
--
Ticket URL: <https://code.djangoproject.com/ticket/33710#comment:3>
* has_patch: 0 => 1
* stage: Unreviewed => Ready for checkin
Comment:
Replying to [comment:3 David Wobrock]:
> I think making the database operation a noop when the old index has the
same name as the new index name can be enough.
> Here is a first draft https://github.com/django/django/pull/15695
Agreed.
--
Ticket URL: <https://code.djangoproject.com/ticket/33710#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"11310e9abbdd784aea4ba50451144fc9c239f71f" 11310e9a]:
{{{
#!CommitTicketReference repository=""
revision="11310e9abbdd784aea4ba50451144fc9c239f71f"
Fixed #33710 -- Made RenameIndex operation a noop when the old and new
name match.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33710#comment:5>