Re: [Django] #35176: Renaming a field and other attributes result in deleting and recreating a new column. (was: Renaming a field and its verbose name result in deleting and recreating a new column in django 4.2)

2 views
Skip to first unread message

Django

unread,
Feb 8, 2024, 6:53:06 AMFeb 8
to django-...@googlegroups.com
#35176: Renaming a field and other attributes result in deleting and recreating a
new column.
----------------------------------+--------------------------------------
Reporter: Corentin Bettiol | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: 4.2
Severity: Normal | Resolution: wontfix
Keywords: rename, renaming | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* type: Bug => New feature
* resolution: => wontfix
* summary:
Renaming a field and its verbose name result in deleting and
recreating a new column in django 4.2
=>
Renaming a field and other attributes result in deleting and
recreating a new column.

Comment:

Migrations are unable to detect that field is renamed after any other
attribute changes. You need to do this in two steps:
- rename a field (generate migrations).
- change a verbose name (generate migrations, this is a no-op).
--
Ticket URL: <https://code.djangoproject.com/ticket/35176#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages