#33197: Providing prior implicit field name to db_column should be a noop
--------------------------------------+------------------------------------
Reporter: Jacob Walls | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Simon Charette):
* stage: Unreviewed => Accepted
Comment:
I think this is due to how the auto-detector
[https://github.com/django/django/blob/514c16e85f7ac2512235f3b6413646627420e969/django/db/migrations/autodetector.py#L182-L185
generates field renames before field alterations]. I assume the issue goes
away if you swap the order of `operations` in your migration?
[https://github.com/django/django/blob/514c16e85f7ac2512235f3b6413646627420e969/tests/migrations/test_autodetector.py#L985-L1011
As this test exemplifies] the `RenameField` operation happens before the
`AlterField` operation does so we'd need to adjust
`generate_renamed_fields` to add an `AlterField` and prevents
`generate_altered_fields` for doing so when this happens.
--
Ticket URL: <https://code.djangoproject.com/ticket/33197#comment:1>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/073.f9a7b7813f62a429c4fd91a6a998b5a5%40djangoproject.com.