#23577: Rename operations should rename indexes, constraints, sequences and
triggers named after their former value
---------------------------------+------------------------------------
     Reporter:  Chris Woytowitz  |                    Owner:  (none)
         Type:  Bug              |                   Status:  new
    Component:  Migrations       |                  Version:  master
     Severity:  Normal           |               Resolution:
     Keywords:                   |             Triage Stage:  Accepted
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+------------------------------------

Comment (by Thomas Riccardi):

 To get the proper new index name:
 {{{#!python
 from django.db import connection
 schema_editor = connection.schema_editor()

 def get_index_name(field):
     return schema_editor._create_index_name(field.model._meta.db_table,
 [field.attname])

 get_index_name(ModelFoo.field_bar.field)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23577#comment:24>
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/068.5363745edb0a5fe08b83ab4e6c6429b0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to