[Django] #34935: makemigrations --check no longer reports missing migrations

4 views
Skip to first unread message

Django

unread,
Oct 29, 2023, 7:00:16 PM10/29/23
to django-...@googlegroups.com
#34935: makemigrations --check no longer reports missing migrations
-------------------------------------------+------------------------
Reporter: Adam Johnson | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.2
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
Before #34051 (Django 4.2), you’d use this invocation to check for pending
migrations:

{{{
$ ./manage.py makemigrations --dry-run --check
Migrations for 'example':
example/migrations/0002_alter_author_name.py
- Alter field name on author

$ echo $?
1
}}}


The to-be-generated migrations were reported.

#34051 changed so that migratinos aren’t generated when using only
`--check`. But that means, with or without `--dry-run`, the migration
operations are no longer output:

{{{
$ ./manage.py makemigrations --dry-run --check

$ echo $?
1
}}}

Thus, to see the pending migrations, the only option is to run again
without `--check` and actually write them out. If you run `makemigrations
--check` in CI, a failure requires an extra run, perhaps locally, before
you can start to debug.

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

Django

unread,
Oct 29, 2023, 7:14:45 PM10/29/23
to django-...@googlegroups.com
#34935: makemigrations --check no longer reports missing migrations
---------------------------------+--------------------------------------

Reporter: Adam Johnson | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.2
Severity: Release blocker | Resolution:

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

Old description:

> Before #34051 (Django 4.2), you’d use this invocation to check for
> pending migrations:
>
> {{{
> $ ./manage.py makemigrations --dry-run --check
> Migrations for 'example':
> example/migrations/0002_alter_author_name.py
> - Alter field name on author
>
> $ echo $?
> 1
> }}}
>

> The to-be-generated migrations were reported.
>
> #34051 changed so that migratinos aren’t generated when using only
> `--check`. But that means, with or without `--dry-run`, the migration
> operations are no longer output:
>
> {{{
> $ ./manage.py makemigrations --dry-run --check
>
> $ echo $?
> 1
> }}}
>
> Thus, to see the pending migrations, the only option is to run again
> without `--check` and actually write them out. If you run `makemigrations
> --check` in CI, a failure requires an extra run, perhaps locally, before
> you can start to debug.

New description:

Before #34051 (Django 4.2), you’d use this invocation to check for pending
migrations:

{{{
$ ./manage.py makemigrations --dry-run --check
Migrations for 'example':
example/migrations/0002_alter_author_name.py
- Alter field name on author

$ echo $?
1
}}}


The to-be-generated migrations were reported.

#34051 changed so that migratinos aren’t generated when using only
`--check`. But that means, with or without `--dry-run`, the migration
operations are no longer output:

{{{
$ ./manage.py makemigrations --dry-run --check

$ echo $?
1
}}}

Thus, to see the pending migrations, the only option is to run again
without `--check` and actually write them out. If you run `makemigrations
--check` in CI, a failure requires an extra run, perhaps locally, before
you can start to debug.

`-v 0` can (and could) always be used to mute the output if desired.

--

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

Reply all
Reply to author
Forward
0 new messages