#35176: Renaming a field and its verbose name results in deleting and recreating a new column in django 4.2 -------------------------------------+------------------------------------- Reporter: Corentin | Owner: nobody Bettiol | Type: Bug | Status: new Component: | Version: 4.2 Migrations | Severity: Normal | Keywords: rename, renaming Triage Stage: | Has patch: 0 Unreviewed | Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | -------------------------------------+------------------------------------- Hi all, When renaming a field of a model in Django, one would expect the makemigration command to realize it should only rename the column in the db.
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. -- 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 django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/0107018d885643fe-9df81873-aef7-406b-838b-56285c6129e0-000000%40eu-central-1.amazonses.com.