#32263: squashmigrations produces incorrect result with a RenameModel on a
ForeignKey target.
-------------------------------------+-------------------------------------
     Reporter:  InvalidInterrupt     |                    Owner:  Anvesh
                                     |  Mishra
         Type:  Bug                  |                   Status:  assigned
    Component:  Migrations           |                  Version:  3.1
     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 Anvesh Mishra):

 After the squashed migration is created if we run `makemigrations` once
 again it creates a new migrations file as such:
 {{{#!python
 class Migration(migrations.Migration):

     dependencies = [
         ("test_one", "0001_squashed_0003_person_birthdate"),
     ]

     operations = [
         migrations.AlterField(
             model_name="book",
             name="author",
             field=models.ForeignKey(
                 on_delete=django.db.models.deletion.PROTECT,
 to="test_one.person"
             ),
         ),
     ]
 }}}
 so the `to` field automatically gets referenced to the right table in the
 new migrations file but still it won't work cause of the previous sqaushed
 migration.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32263#comment:12>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070184606eb5e1-37437ba8-4aa1-4826-8052-a65d0f64341a-000000%40eu-central-1.amazonses.com.

Reply via email to