#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 mkoistinen):

 Until this is resolved, one can work-around this issue by doing something
 like:

 {{{
         migrations.RunSQL(
             'ALTER INDEX myapp_mymodel_myfield_othermodel_id_0f4cfc54
 rename TO myapp_mymodel_myfield_othermodel_legacy_id_0f4cfc54',
             'ALTER INDEX
 myapp_mymodel_myfield_othermodel_legacy_id_0f4cfc54 rename TO
 myapp_mymodel_myfield_othermodel_id_0f4cfc54',
         )
 }}}

 This sort of approach should work well for both FKs and M2Ms (example
 below), but it may make your migrations DB Backend specific =/

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

Reply via email to