Re: [Django] #31504: Allow makemigrations to skip database consistency checks

22 views
Skip to first unread message

Django

unread,
Apr 22, 2020, 1:08:00 PM4/22/20
to django-...@googlegroups.com
#31504: Allow makemigrations to skip database consistency checks
-----------------------------+--------------------------------------
Reporter: Tom Forbes | Owner: nobody
Type: New feature | Status: new
Component: Migrations | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+--------------------------------------
Changes (by Ian Bottomley):

* cc: Ian Bottomley (added)


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

Django

unread,
Apr 23, 2020, 3:03:36 AM4/23/20
to django-...@googlegroups.com
#31504: Allow makemigrations to skip database consistency checks
-----------------------------+------------------------------------
Reporter: Tom Forbes | Owner: nobody
Type: New feature | Status: new
Component: Migrations | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by Carlton Gibson):

* stage: Unreviewed => Accepted


Comment:

OK, this seems reasonable to me. (Others can shout if I missed something.
:)

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

Django

unread,
Apr 25, 2020, 11:11:21 AM4/25/20
to django-...@googlegroups.com
#31504: Allow makemigrations to skip database consistency checks
-----------------------------+------------------------------------
Reporter: Tom Forbes | Owner: wtkm11
Type: New feature | Status: assigned

Component: Migrations | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by wtkm11):

* owner: nobody => wtkm11
* status: new => assigned


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

Django

unread,
Apr 25, 2020, 3:35:13 PM4/25/20
to django-...@googlegroups.com
#31504: Allow makemigrations to skip database consistency checks
-----------------------------+------------------------------------
Reporter: Tom Forbes | Owner: wtkm11
Type: New feature | Status: assigned
Component: Migrations | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by wtkm11):

I added the --skip-consistency-check flag to allow skipping the
inconsistent migration history check in the makemigrations command along
with a unit test in tests.migrations.test_commands::MakeMigrationsTests.

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

Django

unread,
Apr 25, 2020, 4:37:43 PM4/25/20
to django-...@googlegroups.com
#31504: Allow makemigrations to skip database consistency checks
-----------------------------+------------------------------------
Reporter: Tom Forbes | Owner: wtkm11
Type: New feature | Status: assigned
Component: Migrations | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by wtkm11):

* has_patch: 0 => 1


Comment:

https://github.com/django/django/pull/12796

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

Django

unread,
Apr 26, 2020, 9:22:53 AM4/26/20
to django-...@googlegroups.com
#31504: Allow makemigrations to skip database consistency checks
-----------------------------+------------------------------------
Reporter: Tom Forbes | Owner: wtkm11
Type: New feature | Status: assigned
Component: Migrations | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Tom Forbes):

I've been thinking more about this - wouldn't it be preferable to
gracefully fail if the `check_consistent_history()` method fails due to a
connection error? Not sure what anyone else thinks, but your MR looks
simple enough. Just make sure you add something to the release notes +
documentation.

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

Django

unread,
Apr 27, 2020, 4:23:56 AM4/27/20
to django-...@googlegroups.com
#31504: Allow makemigrations to skip database consistency checks
-----------------------------+------------------------------------
Reporter: Tom Forbes | Owner: wtkm11
Type: New feature | Status: assigned
Component: Migrations | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1


Comment:

I agree with Tom, this is quite niche so I would also prefer to fail
gracefully. IMO we don't need a new option.

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

Django

unread,
Apr 30, 2020, 3:03:43 PM4/30/20
to django-...@googlegroups.com
#31504: Allow makemigrations to skip database consistency checks
-----------------------------+------------------------------------
Reporter: Tom Forbes | Owner: wtkm11
Type: New feature | Status: assigned
Component: Migrations | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by wtkm11):

I updated the PR so that a CommandError describing the error that was
encountered in check_consistent_history will be raised.

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

Django

unread,
Apr 30, 2020, 3:43:42 PM4/30/20
to django-...@googlegroups.com
#31504: Allow makemigrations to skip database consistency checks
-----------------------------+------------------------------------
Reporter: Tom Forbes | Owner: wtkm11
Type: New feature | Status: assigned
Component: Migrations | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by wtkm11):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/31504#comment:9>

Django

unread,
May 1, 2020, 4:51:16 PM5/1/20
to django-...@googlegroups.com
#31504: Allow makemigrations to skip database consistency checks
-----------------------------+------------------------------------
Reporter: Tom Forbes | Owner: wtkm11
Type: New feature | Status: assigned
Component: Migrations | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by wtkm11):

I just updated the PR again so that a warning describing the error that
was encountered in check_consistent_history will be issued (and the
command will be able to continue).

--
Ticket URL: <https://code.djangoproject.com/ticket/31504#comment:10>

Django

unread,
May 18, 2020, 5:57:10 AM5/18/20
to django-...@googlegroups.com
#31504: Allow makemigrations to skip database consistency checks
-----------------------------+---------------------------------------------

Reporter: Tom Forbes | Owner: wtkm11
Type: New feature | Status: assigned
Component: Migrations | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by felixxm):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/31504#comment:11>

Django

unread,
May 19, 2020, 4:51:26 AM5/19/20
to django-...@googlegroups.com
#31504: Allow makemigrations to skip database consistency checks
-----------------------------+---------------------------------------------
Reporter: Tom Forbes | Owner: wtkm11
Type: New feature | Status: closed
Component: Migrations | Version: 3.0
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: 1 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"9756c334294ad573d887b449e2fe1cc87387af40" 9756c334]:
{{{
#!CommitTicketReference repository=""
revision="9756c334294ad573d887b449e2fe1cc87387af40"
Fixed #31504 -- Allowed calling makemigrations without an active database
connection.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31504#comment:12>

Django

unread,
Dec 2, 2024, 12:15:50 PM12/2/24
to django-...@googlegroups.com
#31504: Allow makemigrations to skip database consistency checks
-----------------------------+---------------------------------------------
Reporter: Tom Forbes | Owner: wtkm11
Type: New feature | Status: closed
Component: Migrations | Version: 3.0
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: 1 | UI/UX: 0
-----------------------------+---------------------------------------------
Comment (by Natalia Bidart):

#35963 is a duplicate pending further clarification from the reporter.
--
Ticket URL: <https://code.djangoproject.com/ticket/31504#comment:13>
Reply all
Reply to author
Forward
0 new messages