On 11/30/2014 05:54 AM, tomv wrote:
> It's important to note that right now, index names are not re-creatable in
> retrospect. They rely on the names of models and fields, that are free to
> be renamed. So a complete rethink will be needed if introspection can no
> longer be used for user-specified types of indexes. For example, maybe the
> user should choose the name, which they should make unique at the app
> level? Or if not, Django will need to either keep a record of the generated
> index name somewhere, or start renaming indexes to keep them up-to-date
> with the components in their names.
I think one way or another with the indexes DEP we will need to surface
the name of an index as an explicit part of its deconstructed
specification (just like with fields, models, etc). This implies
probably letting the user pick an explicit name if they want. We could
also keep the option of using an autogenerated default name, but in that
case migrations should notice if that autogenerated name changes and
generate an index-name-change operation.
> What's the best way to proceed with the index name collision ticket #23577
> <
https://code.djangoproject.com/ticket/23577> at this point then? I can:
>
> 1. re-write my "use migration names in index names" branch
> <
https://github.com/tomviner/django/compare/ticket_23577_with_poc_migration_name_fix>
> to allow index suffix names passed from migration operations?
What about having the entire index name explicitly passed from the
operation in migrations (even if for now its always autogenerated
there)? That seems like maybe a step towards where I think we'll
eventually need to be. (But take with a grain of salt, you've been in
this code and I haven't).
> 2. or declare there's no consensus on the solution / we'll wait for
> Mark's index DEP - in which case, can I submit my tests
> <
https://github.com/tomviner/django/compare/ticket_23577_with_tests> as
> xfails?
Hmm, that's an interesting idea. It's not something we've generally done
in the past, but it might be better than just letting the tests bit-rot
as an un-merged PR, later probably needing to be rebased. I'm curious
what others think of the idea of actually merging xfail tests for
unfixed bugs?
Carl