However, when also renaming the verbose_name, the makemigration command
will create a migration file which will delete the column (and all the
data it contains), and create a new column.
See the resulting migrations files generated for an example (new project
named "a", new app named "b", a simple model containing 2 fields).
I think the makemigration command should handle this case by not deleting
data, because we expect it to know that it only needs to rename the
column.
--
Ticket URL: <https://code.djangoproject.com/ticket/35176>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "0001_initial.py" added.
First migration: create the model in db, with 2 fields.
* Attachment "0002_rename_a_field_mymodel_a_field_renamed.py" added.
Working rename of a field: field "a_field" was renamed "a_field_renamed",
using migrations.RenameField.
* Attachment "0003_remove_mymodel_another_field_and_more.py" added.
Nonworking migration: the field "another_field" was deleted, and a new
field named "another_field_renamed" was created. Only difference with the
previous migration is that the verbose_name of the field also changed.