#30065: Bug in django migrations
-------------------------------------+-------------------------------------
               Reporter:             |          Owner:  nobody
  ZaArsProgger                       |
                   Type:  Bug        |         Status:  new
              Component:             |        Version:  1.11
  Migrations                         |       Keywords:  migration, unique,
               Severity:  Normal     |  together, model
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I found bug in migrations.

 I had Model2 with FK to other Model1 and unique_key (model1, ...)
 Then I changed Model2 - removed FK to Model1, created FK to Model3 and
 changed unique_key on (model3, ...)

 It resulted as follows:

         migrations.RemoveField(
             model_name='model1',
             name='model1',
         ),
         migrations.AlterUniqueTogether(
             name='model1',
             unique_together=set([('model3', 'day', 'comment')]),
         ),

 Applying migrations raised django.core.exceptions.FieldDoesNotExist

 It was corrected when I interchanged operations

         migrations.AlterUniqueTogether(
             name='model1',
             unique_together=set([('model3', 'day', 'comment')]),
         ),
         migrations.RemoveField(
             model_name='model1',
             name='model1',
         ),

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30065>
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/055.0d798b2ab287fc16a6b1083cc9bea45f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to