#28987: makemigrations doesn't catch ManyToManyField type change, leaves DB in
inconsistent state
----------------------------------------+---------------------------------
Reporter: MSleepyPanda | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 2.0
Severity: Normal | Keywords: ManyToManyField
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------+---------------------------------
Steps to reproduce:
Create Models:
{{{
class Bar(models.Model):
pass
class Foo(models.Model):
bar = models.ManyToManyField('Bar', blank=True)
}}}
Migrate:
{{{
./manage.py makemigrations app
./manage.py migrate
}}}
Change type of the ManyToManyField to Foo:
{{{
class Bar(models.Model):
pass
class Foo(models.Model):
bar = models.ManyToManyField('Foo', blank=True)
}}}
Migrate (see above)
In the admin page, navigate to "add Foo", click save
You should see an OperationalError, "no such column:
app_foo_bar.from_foo_id"
--
Ticket URL: <https://code.djangoproject.com/ticket/28987>
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/055.ec5400dca02c4b03ebaba5237a4620d4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.