[Django] #26075: Verbiage when using the makemigrations command with an interactive interpreter to remove null = True from a model field is misleading.

3 views
Skip to first unread message

Django

unread,
Jan 12, 2016, 9:46:32 PM1/12/16
to django-...@googlegroups.com
#26075: Verbiage when using the makemigrations command with an interactive
interpreter to remove null = True from a model field is misleading.
--------------------------------------------+-------------------------
Reporter: markamodo | Owner: markamodo@…
Type: Uncategorized | Status: new
Component: Core (Management commands) | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------------+-------------------------
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
[https://github.com/django/django/blob/a7752780d9e78e12d0bd7bd2dcf920d304e039bc/django/db/backends/base/schema.py#L560
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".

--
Ticket URL: <https://code.djangoproject.com/ticket/26075>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 12, 2016, 11:15:33 PM1/12/16
to django-...@googlegroups.com
#26075: Verbiage when using the makemigrations command with an interactive
interpreter to remove null = True from a model field is misleading.
-------------------------------------+-------------------------------------
Reporter: markamodo | Owner:
Type: | markamodo@…
Cleanup/optimization | Status: new
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by MarkusH):

* needs_better_patch: => 0
* needs_tests: => 0
* version: 1.8 => master
* needs_docs: => 0
* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/26075#comment:1>

Django

unread,
Apr 3, 2016, 8:54:13 AM4/3/16
to django-...@googlegroups.com
#26075: Verbiage when using the makemigrations command with an interactive
interpreter to remove null = True from a model field is misleading.
-------------------------------------+-------------------------------------
Reporter: markamodo | Owner: susan
Type: | Status: assigned
Cleanup/optimization |

Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by susan):

* owner: markamodo@… => susan
* cc: susan.tan.fleckerl@… (added)
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/26075#comment:2>

Django

unread,
Apr 3, 2016, 9:37:33 AM4/3/16
to django-...@googlegroups.com
#26075: Verbiage when using the makemigrations command with an interactive
interpreter to remove null = True from a model field is misleading.
-------------------------------------+-------------------------------------
Reporter: markamodo | Owner: susan
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by susan):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/26075#comment:3>

Django

unread,
Apr 3, 2016, 9:41:02 AM4/3/16
to django-...@googlegroups.com
#26075: Verbiage when using the makemigrations command with an interactive
interpreter to remove null = True from a model field is misleading.
-------------------------------------+-------------------------------------
Reporter: markamodo | Owner: susan
Type: | Status: assigned
Cleanup/optimization |
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by susan):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/26075#comment:4>

Django

unread,
Apr 3, 2016, 11:14:21 AM4/3/16
to django-...@googlegroups.com
#26075: Verbiage when using the makemigrations command with an interactive
interpreter to remove null = True from a model field is misleading.
-------------------------------------+-------------------------------------
Reporter: markamodo | Owner: susan
Type: | Status: closed

Cleanup/optimization |
Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Markus Holtermann <info@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"b0803d64c4cd24c580a503cfe268e521128f45d7" b0803d6]:
{{{
#!CommitTicketReference repository=""
revision="b0803d64c4cd24c580a503cfe268e521128f45d7"
Fixed #26075 -- Added clearer wording for one-off values in makemigrations
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26075#comment:5>

Reply all
Reply to author
Forward
0 new messages