This occurs in Django 1.8. I had no problem with any of 1.7.x version,
last tested was 1.7.7. Simplified snippet attached below runs smoothly
with version 1.7 and should reproduce the error in 1.8.
--
Ticket URL: <https://code.djangoproject.com/ticket/24573>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "0001_inital.py" added.
* Attachment "traceback.py" added.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> 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 version,
> last tested was 1.7.7. Simplified snippet attached below runs smoothly
> with version 1.7 and should reproduce the error in 1.8.
New description:
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.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/24573#comment:1>
* status: new => assigned
* severity: Normal => Release blocker
* needs_tests: 0 => 1
* owner: nobody => MarkusH
* needs_docs: 0 => 1
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
Comment:
Ok, it took me a while, but I can confirm that bug.
PR: https://github.com/django/django/pull/4447
--
Ticket URL: <https://code.djangoproject.com/ticket/24573#comment:2>
* cc: joostrijneveld@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/24573#comment:3>
* needs_docs: 1 => 0
* needs_tests: 1 => 0
Comment:
I finally added a test case. Ready for review.
--
Ticket URL: <https://code.djangoproject.com/ticket/24573#comment:4>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/24573#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"b93690c4652a108b4305c0df34509bfc267fd927" b93690c4]:
{{{
#!CommitTicketReference repository=""
revision="b93690c4652a108b4305c0df34509bfc267fd927"
Fixed #24573 -- Considered new related models for reloading
Thanks tttomekkk for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24573#comment:6>
Comment (by Markus Holtermann <info@…>):
In [changeset:"0cacb8f8ba94b06a78dcdfa22dc406a8a20a7f88" 0cacb8f8]:
{{{
#!CommitTicketReference repository=""
revision="0cacb8f8ba94b06a78dcdfa22dc406a8a20a7f88"
[1.8.x] Fixed #24573 -- Considered new related models for reloading
Thanks tttomekkk for the report.
Backport of b93690c4652a108b4305c0df34509bfc267fd927 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24573#comment:7>