Ticket #477 (assigned defect)
Related models from a parent model that has been inherited are not available in migrations
| Reported by: | KyleMac | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 1.0 |
| Component: | migrations | Version: | 0.7.1 |
| Keywords: | Cc: |
Description
If you migrate a child model then the parent is available on the orm but foreign keys to and from the parent model are not.
This comes into play with data migratons as you can't update related fields from the child model, and there's no way to do it the other way round (i.e. do all children from the parent) because the parent rightly has no idea about the children.
Attachments
Change History
comment:2 Changed 3 years ago by andrew
- Status changed from new to assigned
- Milestone set to 1.0
This actually seems like it might be possible to replicate in the frozen ORM; after all, the same data is available there as in the main ORM (and the parent should be auto-frozen).
comment:4 Changed 3 years ago by KyleMac
My quick solution of this at the time was exactly that; copy and paste the model I needed from a migration in the "core" app into the frozen ORM in the inheriting app.
But now I've run into another problem with this since when the model in the core app is updated, any apps with the copy and pasted frozen orm is not. This leads to things from obvious errors to data just disappearing unless I remember to manually copy and paste the current model.

The only way I can think of solving this is to have some kind of --include-model option to pull in models that South can't autodetect.