Opened 8 years ago

Closed 8 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 Markus Holtermann, 8 years ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization
Version: 1.8master

comment:2 by Susan Tan, 8 years ago

Cc: susan.tan.fleckerl@… added
Owner: changed from markamodo@… to Susan Tan
Status: newassigned

comment:3 by Susan Tan, 8 years ago

https://github.com/django/django/pull/6398 is the PR. Is this what you're looking for?

comment:4 by Susan Tan, 8 years ago

Has patch: set

comment:5 by Markus Holtermann <info@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In b0803d6:

Fixed #26075 -- Added clearer wording for one-off values in makemigrations

Note: See TracTickets for help on using tickets.
Back to Top