#34051 closed Cleanup/optimization (fixed)
makemigrations --check generating migrations is inconsistent with other uses of --check
Reported by: | Jacob Walls | Owned by: | Jacob Walls |
---|---|---|---|
Component: | Migrations | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | 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
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 PR to adjust the documentation of migrate --check. I think the current documentation is silent on this question.
Change History (8)
comment:1 by , 2 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 2 years ago
Needs documentation: | set |
---|---|
Patch needs improvement: | set |
comment:4 by , 2 years ago
Needs documentation: | unset |
---|---|
Patch needs improvement: | unset |
comment:5 by , 2 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:7 by , 11 months ago
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.
I think this makes sense.