#31788: Models migration with change field foreign to many and deleting unique
together.
----------------------------+------------------------------------
     Reporter:  budzichd    |                    Owner:  nobody
         Type:  Bug         |                   Status:  new
    Component:  Migrations  |                  Version:  3.0
     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
----------------------------+------------------------------------
Changes (by felixxm):

 * cc: Markus Holtermann, Simon Charette (added)
 * stage:  Unreviewed => Accepted


Comment:

 Thanks for the report. Tentatively accepting, however I'm not sure if we
 can sort these operations properly, we should probably alter
 `unique_together` first
 {{{
         migrations.AlterUniqueTogether(
             name='authors',
             unique_together=set(),
         ),
         migrations.RemoveField(
             model_name='authors',
             name='project_data_set',
         ),
         migrations.AddField(
             model_name='authors',
             name='project_data_set',
             field=models.ManyToManyField(to='dict.ProjectDataSet'),
         ),
 }}}

 You should take into account that you'll lose all data  because
 ``ForeignKey`` cannot be altered to ``ManyToManyField``.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31788#comment:3>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.bf50ba16a56222ade58f56d2c30b66e4%40djangoproject.com.

Reply via email to