#24157: Prompt to add a new field after renaming
----------------------------+--------------------
Reporter: basilu | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------
I have noticed a slightly weird logic of makemigration command after
renaming a field in a model.py.
So, I did this:
1. Rename field
from
{{{#!python
descr = models.TextField('description')
}}}
to
{{{#!python
description = models.TextField()
}}}
2. Invoke
{{{
manage.py makemigrations
}}}
And migration logic decided that I had added a new field //description//
and asked me to provide default value.
But if to perform renaming this way:
from
{{{#!python
descr = models.TextField('description')
}}}
to
{{{#!python
description = models.TextField('description') # note a passed verbose name
argument
}}}
then migration logic works well and recognizes renaming.
--
Ticket URL: <https://code.djangoproject.com/ticket/24157>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.90d3e6eb083b3fd1bd26b71e22f00ac6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.