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.
* 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>
* owner: markamodo@… => susan
* cc: susan.tan.fleckerl@… (added)
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/26075#comment:2>
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>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/26075#comment:4>
* 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>