#29574: Django Foreign Key Mismatch
----------------------------+--------------------------------------
Reporter: josephbiko | Owner: (none)
Type: Bug | Status: closed
Component: Migrations | Version: 2.1
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------
Comment (by Simon Charette):
Upon further inspection I assume you had an existing `B` entry before
attempting to run the migration that adds the `B.a_ptr` primary key and it
failed because no rows were present in the newly added `A` table?
In this case I think you should be in charge of populating `A` with a data
migration (either using `RunPython` or `RunSQL`) instead of expecting
Django to do it for you.
--
Ticket URL: <https://code.djangoproject.com/ticket/29574#comment:4>
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.2f6027041629f924240ecb0d9e1271f2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.