#32805: makemigrations seems to generate an unnecessary AlterField
-------------------------------------+-------------------------------------
Reporter: Matthew | Owner: nobody
Cornell |
Type: | Status: new
Uncategorized |
Component: Database | Version: 3.1
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I have a model that's evolved over time. I needed to hand-code my last
migration ( migrations/0017_forecast_issued_at.py ) to migrate existing
data from a `DateField` to a `DateTimeField`. However, when I then run
`makemigrations` ( migrations/0018_auto_20210601_0946.py ), it generates
what looks to me like a redundant `AlterField` operation where it wants to
set the new `DateTimeField`'s `db_index=True` even though it's already
True in the previous (0017) migration. I've attached the model file (
models/forecast.py ) plus the two migration files. Questions: Is this
behavior expected? Thank you!
--
Ticket URL: <https://code.djangoproject.com/ticket/32805>
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/057.2e3af1ccdec0aa05ddc581e7f32a3dbe%40djangoproject.com.