#24282: Cannot Modify Foreign Keys Within Data Migrations
---------------------------------+-------------------------------------
     Reporter:  jeffasinger      |                    Owner:
         Type:  Bug              |                   Status:  new
    Component:  Migrations       |                  Version:  1.8alpha1
     Severity:  Release blocker  |               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 jeffasinger):

 Still fails unfortunately when tested against that patch.

 I am having trouble creating a failing test case though. The PR definitely
 seems related.

 Here's a few things I've noticed since today:

 1. It's not actually a ForeignKey, but the forward end of a OneToOneField.
 I'm doubting that matters, but I figured I'd throw that out there.
 2. The repr of type(a) and field.rel.to are the same, however, the id of
 them is not the same.
 3. The id of type(a) is the same as the one in the apps.all_models
 dictionary.
 4. Stepping through several migrations of the same app, the id(type(a)) is
 different each time, which makes sense, as the model is changing. However,
 id(field.rel.to) does not match the current version of a, but one from a
 previous migration.

 Hope that helps a little bit, in the mean time, I'll keep trying to get a
 testcase that reproduces this.

--
Ticket URL: <https://code.djangoproject.com/ticket/24282#comment:8>
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/069.9087aad61a0e3456fd5ad711529e845e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to