#29574: Unable to create model instance after changing an abstract model to non-
abstract due to "foreign key mismatch" error
----------------------------+-------------------------------------
Reporter: josephbiko | Owner: Calvin Vu
Type: Bug | Status: assigned
Component: Migrations | Version: 2.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 Calvin Vu):
It seems like Bhuvnesh correctly identified the cause. A potential
solution would be to first set `C.fk` to `A.id` (which is going to be the
`id` of model 'AB', i.e., the separate tables A and B, which are connected
one-to-one with `B.a_ptr_id` when model A is made concrete), then change
model B to inherit from model A (to form model 'AB'), and then update any
existing data.
--
Ticket URL: <https://code.djangoproject.com/ticket/29574#comment:15>
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/010701928c31eb8f-fa4da203-8ecf-4680-9797-3e0d958a8faa-000000%40eu-central-1.amazonses.com.