Opened 9 years ago
Closed 9 years ago
#26075 closed Cleanup/optimization (fixed)
Verbiage when using the makemigrations command with an interactive interpreter to remove null = True from a model field is misleading.
Reported by: | Mark McHenry | Owned by: | Susan Tan |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | markamodo@…, susan.tan.fleckerl@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Verbiage when using the makemigrations command with an interactive interpreter to remove null from a model field is misleading.
I added null = True to foreignkey field and applied a migration. I want to revert the change and am being prompted during the second migration that a default must be provided for existing rows.
The first option for addressing this says to provide a one-off and then states, "will be set on all existing rows".
This verbiage indicates that existing values will be replaced with the one-off.
In reality, according to the Django source here, this will only apply the one-off value to rows which currently have a null value for this column.
I am filing this ticket to have the verbiage updated to more accurately reflect what will occur. My recommended replacement text is "will be set on all existing rows with a null value for this column".
Change History (5)
comment:1 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Cleanup/optimization |
Version: | 1.8 → master |
comment:2 by , 9 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 9 years ago
comment:4 by , 9 years ago
Has patch: | set |
---|
https://github.com/django/django/pull/6398 is the PR. Is this what you're looking for?