[Django] #31402: Add --check flag to showmigrations

13 views
Skip to first unread message

Django

unread,
Mar 25, 2020, 4:07:32 PM3/25/20
to django-...@googlegroups.com
#31402: Add --check flag to showmigrations
-----------------------------------------+------------------------
Reporter: nickname123 | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.0
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 |
-----------------------------------------+------------------------
It would be helpful if there was a flag for `showmigrations` that acted
similar to `makemigrations --check` that could be used to stop CI from
deploying an application automatically when database migrations would be
needed.

`showmigrations` is preferred to `migrate` for this purpose so a typo
doesn't accidentally run the migrations but I suppose that isn't super
important

One currently needs to parse output. It seems like this would be
universally useful

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

Django

unread,
Mar 26, 2020, 1:36:40 AM3/26/20
to django-...@googlegroups.com
#31402: Add --check flag to showmigrations.
-------------------------------------+-------------------------------------
Reporter: nickname123 | Owner: nobody
Type: New feature | Status: closed
Component: Core (Management | Version: 3.0
commands) |
Severity: Normal | Resolution: wontfix

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 felixxm):

* status: new => closed
* resolution: => wontfix
* type: Uncategorized => New feature
* component: Uncategorized => Core (Management commands)


Comment:

Thanks for this ticket, however I don't see why you cannot use
`makemigrations --check` for the same purpose. You can start a discussion
on DevelopersMailingList if you don't agree.

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

Django

unread,
Mar 26, 2020, 3:14:03 AM3/26/20
to django-...@googlegroups.com
#31402: Add --check flag to migrate.
-------------------------------------+-------------------------------------
Reporter: nickname123 | Owner: nobody

Type: New feature | Status: closed
Component: Core (Management | Version: 3.0
commands) |
Severity: Normal | Resolution: wontfix
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 felixxm):

* stage: Unreviewed => Accepted


Old description:

> It would be helpful if there was a flag for `showmigrations` that acted
> similar to `makemigrations --check` that could be used to stop CI from
> deploying an application automatically when database migrations would be
> needed.
>
> `showmigrations` is preferred to `migrate` for this purpose so a typo
> doesn't accidentally run the migrations but I suppose that isn't super
> important
>
> One currently needs to parse output. It seems like this would be
> universally useful

New description:

It would be helpful if there was a flag for `migrate` that acted similar


to `makemigrations --check` that could be used to stop CI from deploying

an application automatically when unapplied migrations exist.

One currently needs to parse output. It seems like this would be

universally useful.

--

Comment:

Based on short discussion https://groups.google.com/d/msg/django-
developers/wr8MYU-d8pU/f86jYOZ6AQAJ.

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

Django

unread,
Mar 26, 2020, 3:23:21 AM3/26/20
to django-...@googlegroups.com
#31402: Add --check flag to migrate.
-------------------------------------+-------------------------------------
Reporter: nickname123 | Owner: nobody
Type: New feature | Status: new

Component: Core (Management | Version: 3.0
commands) |
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 thenewguy):

* status: closed => new
* resolution: wontfix =>


Old description:

> It would be helpful if there was a flag for `migrate` that acted similar


> to `makemigrations --check` that could be used to stop CI from deploying

> an application automatically when unapplied migrations exist.


>
> One currently needs to parse output. It seems like this would be

> universally useful.

New description:

It would be helpful if there was a flag for `migrate` that acted similar


to `makemigrations --check` that could be used to stop CI from deploying

an application automatically when unapplied migrations exist.

This is different from `makemigrations --check` because the new command
flag would tell us if we need to *run* any migrations where as
`makemigrations --check` tells us if we need to *create* any migrations.

One currently needs to parse output. It seems like this would be

universally useful.

--

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

Django

unread,
Mar 26, 2020, 5:37:07 AM3/26/20
to django-...@googlegroups.com
#31402: Add --check flag to migrate.
-------------------------------------+-------------------------------------
Reporter: nickname123 | Owner: nobody

Type: New feature | Status: new
Component: Core (Management | Version: 3.0
commands) |
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 thenewguy):

* has_patch: 0 => 1


Comment:

I opened PR https://github.com/django/django/pull/12630

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

Django

unread,
Mar 26, 2020, 6:11:10 AM3/26/20
to django-...@googlegroups.com
#31402: Add --check flag to migrate.
-------------------------------------+-------------------------------------
Reporter: nickname123 | Owner: nobody

Type: New feature | Status: new
Component: Core (Management | Version: 3.0
commands) |
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 felixxm):

* needs_better_patch: 0 => 1


Comment:

Please don't mark WIP PRs as ready for review.

--
Ticket URL: <https://code.djangoproject.com/ticket/31402#comment:5>

Django

unread,
Mar 26, 2020, 6:27:27 AM3/26/20
to django-...@googlegroups.com
#31402: Add --check flag to migrate.
-------------------------------------+-------------------------------------
Reporter: nickname123 | Owner: nobody

Type: New feature | Status: new
Component: Core (Management | Version: 3.0
commands) |
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
-------------------------------------+-------------------------------------

Comment (by thenewguy):

Replying to [comment:5 felixxm]:


> Please don't mark WIP PRs as ready for review.


My mistake. The failing test seems unrelated. Any suggestions?

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

Django

unread,
Mar 26, 2020, 8:22:52 AM3/26/20
to django-...@googlegroups.com
#31402: Add --check flag to migrate.
-------------------------------------+-------------------------------------
Reporter: nickname123 | Owner: thenewguy
Type: New feature | Status: assigned
Component: Core (Management | Version: master
commands) |
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 felixxm):

* owner: nobody => thenewguy
* needs_better_patch: 1 => 0
* version: 3.0 => master
* status: new => assigned
* stage: Accepted => Ready for checkin


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

Django

unread,
Mar 26, 2020, 9:48:46 AM3/26/20
to django-...@googlegroups.com
#31402: Add --check flag to migrate.
-------------------------------------+-------------------------------------
Reporter: nickname123 | Owner: thenewguy
Type: New feature | Status: assigned
Component: Core (Management | Version: master
commands) |
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 Simon Charette):

* cc: Simon Charette (added)
* stage: Ready for checkin => Accepted


Comment:

Please don't mark your own patch as ''Ready for checkin''', checking ''Has
patch'' is sufficient to appear in the review queue.

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

Django

unread,
Mar 27, 2020, 1:12:53 AM3/27/20
to django-...@googlegroups.com
#31402: Add --check flag to migrate.
-------------------------------------+-------------------------------------
Reporter: nickname123 | Owner: thenewguy
Type: New feature | Status: closed

Component: Core (Management | Version: master
commands) |
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:"d0da2820cab495c35eac10680213f927be8b91b0" d0da2820]:
{{{
#!CommitTicketReference repository=""
revision="d0da2820cab495c35eac10680213f927be8b91b0"
Fixed #31402 -- Added migrate --check option.

Command exits with non-zero status if unapplied migrations exist.
}}}

Reply all
Reply to author
Forward
0 new messages