[Django] #34051: makemigrations --check generating migrations is inconsistent with other uses of --check

18 views
Skip to first unread message

Django

unread,
Sep 25, 2022, 12:28:48 AM9/25/22
to django-...@googlegroups.com
#34051: makemigrations --check generating migrations is inconsistent with other
uses of --check
------------------------------------------------+------------------------
Reporter: Jacob Walls | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: dev
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 |
------------------------------------------------+------------------------
To script a check for missing migrations but without actually intending to
create the migrations, it is necessary to use both `--check` and `--dry-
run`, which is inconsistent with `migrate --check` and `optimizemigration
--check`, which just exit (after possibly logging a bit).

I'm suggesting that `makemigrations --check` should just exit without
making migrations.

The choice to write the migrations anyway was not discussed AFAICT on
ticket:25604 or https://groups.google.com/g/django-
developers/c/zczdY6c9KSg/m/ZXCXQsGDDAAJ.

Noticed when reading
[https://github.com/django/django/pull/15845#issue-1305277307 PR to adjust
the documentation of migrate --check]. I think the current documentation
is silent on this question.

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

Django

unread,
Sep 25, 2022, 3:41:14 PM9/25/22
to django-...@googlegroups.com
#34051: makemigrations --check generating migrations is inconsistent with other
uses of --check
--------------------------------------+------------------------------------

Reporter: Jacob Walls | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: dev
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 Claude Paroz):

* stage: Unreviewed => Accepted


Comment:

I think this makes sense.

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

Django

unread,
Sep 25, 2022, 7:55:19 PM9/25/22
to django-...@googlegroups.com
#34051: makemigrations --check generating migrations is inconsistent with other
uses of --check
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: assigned

Component: Migrations | Version: dev
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):

* owner: nobody => Jacob Walls
* status: new => assigned
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/16116 PR]

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

Django

unread,
Sep 26, 2022, 12:05:08 AM9/26/22
to django-...@googlegroups.com
#34051: makemigrations --check generating migrations is inconsistent with other
uses of --check
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: assigned
Component: Migrations | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1
* needs_docs: 0 => 1


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

Django

unread,
Sep 27, 2022, 8:27:38 AM9/27/22
to django-...@googlegroups.com
#34051: makemigrations --check generating migrations is inconsistent with other
uses of --check
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: assigned
Component: Migrations | Version: dev
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
* needs_docs: 1 => 0


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

Django

unread,
Sep 28, 2022, 3:45:22 AM9/28/22
to django-...@googlegroups.com
#34051: makemigrations --check generating migrations is inconsistent with other
uses of --check
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: assigned
Component: Migrations | Version: dev
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/34051#comment:5>

Django

unread,
Sep 28, 2022, 4:18:32 AM9/28/22
to django-...@googlegroups.com
#34051: makemigrations --check generating migrations is inconsistent with other
uses of --check
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: closed
Component: Migrations | Version: dev
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:"80d38de52bb2721a7b44fce4057bcff571afc23a" 80d38de5]:
{{{
#!CommitTicketReference repository=""
revision="80d38de52bb2721a7b44fce4057bcff571afc23a"
Fixed #34051 -- Made makemigrations --check exit before making migrations.
}}}

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

Django

unread,
Jan 18, 2024, 8:36:45 AM1/18/24
to django-...@googlegroups.com
#34051: makemigrations --check generating migrations is inconsistent with other
uses of --check
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: closed
Component: Migrations | Version: dev
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
-------------------------------------+-------------------------------------

Comment (by Daniel Hahler):

I was using `--check --dry-run` to see missing migrations on CI already,
which now becomes silent.

Would it make sense to have migrations still being written/printed in case
`--dry-run` is used.

Or is there another option to get the desired behavior on CI?

(You could use `--check` first an in case of exiting with 1 use `--dry-
run` alone, but I think the old behavior was good).

I am using also `-v3` to make it very verbose - maybe that could be taken
into consideration also.

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

Django

unread,
Jan 18, 2024, 8:39:01 AM1/18/24
to django-...@googlegroups.com
#34051: makemigrations --check generating migrations is inconsistent with other
uses of --check
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: closed
Component: Migrations | Version: dev
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
-------------------------------------+-------------------------------------

Comment (by Daniel Hahler):

Oh, addressed/fixed in #34457 already.

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

Reply all
Reply to author
Forward
0 new messages