#34457 closed Bug (fixed)
makemigrations --check no longer prints the changes
Reported by: | David Sanders | Owned by: | Adam Johnson |
---|---|---|---|
Component: | Migrations | Version: | 4.2 |
Severity: | Release blocker | Keywords: | |
Cc: | Claude Paroz, Jacob Walls | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
As a result of #34051 the --check
flag on makemigrations simply exits 1 without writing any changes.
This makes sense as it's consistent with other uses of --check
.
However one consequence of this change is that my CI server no longer prints the changes it thinks I need to make – and this makes the situations where the local dev & CI are different, harder to debug.
I'd like to propose reverting this change and instead forcing --dry-run
to be set if --check
is supplied. This way makemigrations goes through the motions of what it needs to write, outputting those changes to the log but the dry flag prevents any migrations from being written.
Change History (19)
comment:1 by , 20 months ago
comment:2 by , 20 months ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Type: | Uncategorized → Cleanup/optimization |
Thanks for the ticket, however I don't think it's worth the inconsistency. You could re-run makemigrations
when makemigrations --check
exists with 1, e.g.
RESULT=`makemigrations --check` if [ "$RESULT" -gt 0 ]; then makemigrations --dry-run fi; exit $RESULT
comment:3 by , 20 months ago
Cc: | added |
---|
comment:4 by , 20 months ago
Or instead of a bash script, use something like if: failure()
in your CI pipeline. Forcing --dry-run
to once again be provided when --check
is provided goes against the original motivation for the change: it's unintuitive (to me) that for --check
you would need to guard against files being written your tree and therefore even know about the --dry-run
option.
comment:5 by , 20 months ago
Forcing --dry-run to once again be provided when --check is provided goes against the original motivation for the change
By forcing I mean makemigrations does the forcing… see the PR for what I mean ;)
comment:6 by , 13 months ago
Triage Stage: | Unreviewed → Accepted |
---|
Accepting based on forum discussion.
comment:7 by , 13 months ago
Resolution: | wontfix |
---|---|
Status: | closed → new |
comment:8 by , 13 months ago
Has patch: | unset |
---|
comment:9 by , 12 months ago
Severity: | Normal → Release blocker |
---|---|
Type: | Cleanup/optimization → Bug |
Marking as a release blocker because I consider it a regression, as discussed on the forum.
comment:10 by , 12 months ago
Has patch: | set |
---|
comment:11 by , 12 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Accepted → Ready for checkin |
comment:12 by , 12 months ago
Patch needs improvement: | set |
---|
comment:13 by , 12 months ago
Patch needs improvement: | unset |
---|
comment:14 by , 12 months ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Ready for checkin → Accepted |
comment:15 by , 12 months ago
Patch needs improvement: | unset |
---|
comment:16 by , 12 months ago
Triage Stage: | Accepted → Ready for checkin |
---|
PR: https://github.com/django/django/pull/16723