I'm not very picky as far as how this functionality should be implemented
goes. I would think that a little warning like
"No migrations run because input was required but --noinput option was
specified."
would be sufficient. This could be output to stdout or stderr, either all
the time or perhaps only if an additional option was set.
--
Ticket URL: <https://code.djangoproject.com/ticket/29470>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => duplicate
Comment:
This looks like a similar request as #29026, even if the proposed
implementation is a bit different.
--
Ticket URL: <https://code.djangoproject.com/ticket/29470#comment:1>
Comment (by Chris Jerdonek):
From a discussion in a [https://github.com/django/django/pull/14751 PR]
for #29026, I think this ticket should be re-opened and handled separately
from #29026. My suggestion for addressing this would be to modify the non-
interactive questioner so that it logs non-empty output when a question is
asked (e.g. saying "Such-and-such question was answered automatically with
..."). This could / should be done using the same output method that the
migration command class is using for its logging output.
--
Ticket URL: <https://code.djangoproject.com/ticket/29470#comment:2>
* status: closed => new
* has_patch: 0 => 1
* resolution: duplicate =>
Comment:
Like Chris, I believe this should be handled separately. Whereas the idea
in #29026 is to move some of `makemigrations`'s current output from
`stdout` to `stderr`, the error messaging asked for in this ticket should
go to `stderr` regardless, so they don't depend on the changes in #29026.
[https://github.com/django/django/pull/14805 PR to ~~implement this part
of Chris's comment:]
> In addition, if the answers to one or more questions (provided either
automatically from --no-input or manually by the user) cause no migrations
to be applied, then the migration command class could log that in any case
so the user knows.
I'm in favor of starting with just that change, and only for the non-
interactive questioner, i.e. `--noinput`.
--
Ticket URL: <https://code.djangoproject.com/ticket/29470#comment:3>
* owner: nobody => Jacob Walls
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/29470#comment:4>
* stage: Unreviewed => Accepted
Comment:
OK, since there's +2 here, let's take a look at a patch. Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/29470#comment:5>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/29470#comment:6>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/29470#comment:7>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/29470#comment:8>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"32f1fe5f89bc9ae98161c07f3676f6aaedc8e877" 32f1fe5]:
{{{
#!CommitTicketReference repository=""
revision="32f1fe5f89bc9ae98161c07f3676f6aaedc8e877"
Fixed #29470 -- Logged makemigrations automatic decisions in non-
interactive mode.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29470#comment:10>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"241ba23870221085cc31ae302b9647f375f9c6c6" 241ba23]:
{{{
#!CommitTicketReference repository=""
revision="241ba23870221085cc31ae302b9647f375f9c6c6"
Refs #29470 -- Added makemigrations test for adding fields with no default
and auto_now_add=True in non-interactive mode.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29470#comment:9>