#23614: Altering unique_together sometimes missing deleted fields
----------------------------+--------------------
Reporter: Naddiseo | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------
Steps to reproduce:
1. Create an App `spam`
2. Create two models `spam.Eggs` and `spam.Spam`
{{{
#!python
class Eggs(models.Model):
pass
class Spam(models.Model):
class Meta:
unique_together = (
('a', 'b'),
)
a = models.ForeignKey(Eggs)
b = models.CharField(max_length=10)
}}}
3. Make migrations
4. Create an App `ham`
5. Create model `ham.Ham`
{{{
#!python
class Ham(models.Model): pass
}}}
6. Add foreignkey to `Spam.Spam`: `c = models.ForeignKey('ham.Ham')`
7. Make Migrations
8. Delete field `Spam.a`
9. Change `Spam.unique_together` to `('c', 'b')`
10. Make Migrations
11. Run migrations.
Output:
> django.db.models.fields.FieldDoesNotExist: Spam has no field named u'a'
I think this might be related to issue #23505 since that is what I was
actually trying to reproduce.
--
Ticket URL: <https://code.djangoproject.com/ticket/23614>
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/051.791782896200d77c4e06329f068ac920%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.