renaming model with self-referential ManyToManyField breaks DB schema
Steps to reproduce:
- initial
models.py
in test
app:
from django.db import models
class Thing(models.Model):
things = models.ManyToManyField('self')
manage.py makemigrations test
from django.db import models
class OtherThing(models.Model):
things = models.ManyToManyField('self')
manage.py makemigrations test
manage.py migrate
from test.models import OtherThing; OtherThing.things.through.objects.all()
<repr(<django.db.models.query.QuerySet at 0x7fcdea125290>) failed: django.db.utils.ProgrammingError: ОШИБКА: колонка test_otherthing_things.from_otherthing_id не существует
LINE 1: SELECT "test_otherthing_things"."id", "test_otherthing_thing...
^
>
Change History
(4)
Severity: |
Normal → Release blocker
|
Triage Stage: |
Unreviewed → Accepted
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
In 463952d94014ac2ea70a96828ddbf1330b504fc7: