[Django] #29470: Add output to makemigrations and migrate commands with --noinput

35 views
Skip to first unread message

Django

unread,
Jun 4, 2018, 10:54:57 AM6/4/18
to django-...@googlegroups.com
#29470: Add output to makemigrations and migrate commands with --noinput
---------------------------------------+------------------------
Reporter: kurtwheeler | Owner: nobody
Type: New feature | Status: new
Component: Migrations | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------+------------------------
The `--noinput` option to makemigrations seems to also mean "no output".
It would be nice for scripting purposes if there could be some kind of
output. When writing a script that helps manage migrations, it would be
nice to be able to detect that the migrations needed input from the
developer so that the script can fail gracefully and inform the developer
that manual intervention is required. Right now the options seem to be to
not use the `--noinput` options and have the prompt interrupt the script,
or to use the option and have no idea when migrations failed because they
required input.

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.

Django

unread,
Jun 8, 2018, 8:02:58 PM6/8/18
to django-...@googlegroups.com
#29470: Add output to makemigrations and migrate commands with --noinput
------------------------------+--------------------------------------
Reporter: Kurt Wheeler | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: 1.11
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by Tim Graham):

* 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>

Django

unread,
Aug 8, 2021, 11:22:22 AM8/8/21
to django-...@googlegroups.com
#29470: Add output to makemigrations and migrate commands with --noinput
------------------------------+--------------------------------------
Reporter: Kurt Wheeler | Owner: nobody
Type: New feature | Status: closed
Component: Migrations | Version: 1.11
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------

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>

Django

unread,
Aug 27, 2021, 2:30:00 PM8/27/21
to django-...@googlegroups.com
#29470: Add output to makemigrations and migrate commands with --noinput
------------------------------+--------------------------------------
Reporter: Kurt Wheeler | Owner: nobody

Type: New feature | Status: new
Component: Migrations | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by Jacob Walls):

* 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>

Django

unread,
Aug 27, 2021, 2:31:19 PM8/27/21
to django-...@googlegroups.com
#29470: Add output to makemigrations and migrate commands with --noinput
------------------------------+---------------------------------------
Reporter: Kurt Wheeler | Owner: Jacob Walls
Type: New feature | Status: assigned
Component: Migrations | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+---------------------------------------
Changes (by Jacob Walls):

* owner: nobody => Jacob Walls
* status: new => assigned


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

Django

unread,
Sep 1, 2021, 3:30:12 AM9/1/21
to django-...@googlegroups.com
#29470: Add output to makemigrations and migrate commands with --noinput
------------------------------+---------------------------------------
Reporter: Kurt Wheeler | Owner: Jacob Walls
Type: New feature | Status: assigned
Component: Migrations | Version: 1.11
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 Carlton Gibson):

* 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>

Django

unread,
Oct 7, 2021, 3:26:49 AM10/7/21
to django-...@googlegroups.com
#29470: Add output to makemigrations and migrate commands with --noinput
------------------------------+---------------------------------------
Reporter: Kurt Wheeler | Owner: Jacob Walls
Type: New feature | Status: assigned
Component: Migrations | Version: 1.11

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

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

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/29470#comment:6>

Django

unread,
Oct 8, 2021, 7:44:55 PM10/8/21
to django-...@googlegroups.com
#29470: Add output to makemigrations and migrate commands with --noinput
------------------------------+---------------------------------------
Reporter: Kurt Wheeler | Owner: Jacob Walls
Type: New feature | Status: assigned
Component: Migrations | Version: 1.11

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 Jacob Walls):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/29470#comment:7>

Django

unread,
Oct 12, 2021, 6:49:11 AM10/12/21
to django-...@googlegroups.com
#29470: Add output to makemigrations and migrate commands with --noinput
-------------------------------------+-------------------------------------

Reporter: Kurt Wheeler | Owner: Jacob
| Walls
Type: New feature | Status: assigned
Component: Migrations | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/29470#comment:8>

Django

unread,
Oct 12, 2021, 2:11:04 PM10/12/21
to django-...@googlegroups.com
#29470: Add output to makemigrations and migrate commands with --noinput
-------------------------------------+-------------------------------------
Reporter: Kurt Wheeler | Owner: Jacob
| Walls
Type: New feature | Status: closed
Component: Migrations | Version: 1.11
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* 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>

Django

unread,
Oct 12, 2021, 2:11:05 PM10/12/21
to django-...@googlegroups.com
#29470: Add output to makemigrations and migrate commands with --noinput
-------------------------------------+-------------------------------------
Reporter: Kurt Wheeler | Owner: Jacob
| Walls
Type: New feature | Status: assigned
Component: Migrations | Version: 1.11
Severity: Normal | Resolution:

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Reply all
Reply to author
Forward
0 new messages