#24354: Migrations that rename subclasses cause problems with relations
-------------------------------+--------------------
Reporter: MatthewWilkes | Owner: nobody
Type: Uncategorized | Status: new
Component: Migrations | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
On a Django 1.7.4 site (and 1.7.x), if you have a model that is the
destination of a relation and subclass that model then migrations for the
subclass incorrectly cause the relations aimed at the parent to be
repointed. The generated migrations look like noops, as the models in
question aren't actually changed. I had this issue today on a DjangoCMS
site, causing migrations to be generated in my django-cms egg.
For example:
{{{
class Author(models.Model):
real_name = models.CharField('name', max_length=50)
class Pseudonym(Author):
pseudonym = models.CharField('name', max_length=50)
class Book(models.Model):
author = models.ForeignKey(Author)
}}}
If the class Pseudonym is renamed then later migrations will ''always''
attempt to reset the author field on book.
This is already fixed on 1.8 and master.
--
Ticket URL: <https://code.djangoproject.com/ticket/24354>
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/056.f22c912d140fa3925cc7df94963cbc63%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.