#24573 closed Bug (fixed)
"Unknown column" exception after removing field in migration.
Reported by: | Tomasz Główka | Owned by: | Markus Holtermann |
---|---|---|---|
Component: | Migrations | Version: | 1.8 |
Severity: | Release blocker | Keywords: | |
Cc: | joostrijneveld@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
When removing field of base class model in my migration and than using RunPython
with subclass model query I face exception django.db.utils.OperationalError: (1054, "Unknown column 'bugapp_person.name' in 'field list'")
. It looks like during migrating, current migration state of submodel does not reflect field removal. Base class is alright though. Additionally, this happens only when at least one extra model with OTO field to base model exists.
This occurs in Django 1.8. I had no problem with any of 1.7.x (1.7.7 recently). Simplified snippet attached below runs smoothly with 1.7 and should reproduce the error under 1.8.
Attachments (2)
Change History (9)
by , 10 years ago
Attachment: | 0001_inital.py added |
---|
by , 10 years ago
Attachment: | traceback.py added |
---|
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 10 years ago
Has patch: | set |
---|---|
Needs documentation: | set |
Needs tests: | set |
Owner: | changed from | to
Severity: | Normal → Release blocker |
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 10 years ago
Cc: | added |
---|
comment:4 by , 10 years ago
Needs documentation: | unset |
---|---|
Needs tests: | unset |
I finally added a test case. Ready for review.
comment:5 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Ok, it took me a while, but I can confirm that bug.
PR: https://github.com/django/django/pull/4447