[Django] #35963: Add option to `makemigrations` to skip checking consistent history

9 views
Skip to first unread message

Django

unread,
Dec 1, 2024, 11:53:29 PM12/1/24
to django-...@googlegroups.com
#35963: Add option to `makemigrations` to skip checking consistent history
--------------------------------+-----------------------------------------
Reporter: Curtis Maloney | Type: Uncategorized
Status: new | Component: Migrations
Version: 5.1 | 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
--------------------------------+-----------------------------------------
Whilst trying to set up a CI pipeline, I've run into the issue that
`makemigrations --cheeck` still tries to connect to the database.

This is a problem because my CI pipeline doesn't have a DB to connect to.

I would like the option to cheaply check within my CI pipeline that there
aren't any obviously forgotten migrations; and "cheaply" here means
"without spending the time + bandwidth to stand up a DB service".
--
Ticket URL: <https://code.djangoproject.com/ticket/35963>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 2, 2024, 2:15:37 AM12/2/24
to django-...@googlegroups.com
#35963: Add option to `makemigrations` to skip checking consistent history
--------------------------------+--------------------------------------
Reporter: Curtis Maloney | Owner: (none)
Type: Uncategorized | Status: new
Component: Migrations | Version: 5.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Comment (by David Sanders):

Normally feature requests have to go through the forum, but I tend to
think we should accept this:

- I doubt the consistency check is useful in a CI context
- Setting up a DB in CI is not always an option if you have no control
over CI
- It appears that skipping the consistency check is all that's required
to get this to work (I did a basic test & confirmation)

Thoughts Sarah/Natalia/anyone else?
--
Ticket URL: <https://code.djangoproject.com/ticket/35963#comment:1>

Django

unread,
Dec 2, 2024, 12:15:16 PM12/2/24
to django-...@googlegroups.com
#35963: Add option to `makemigrations` to skip checking consistent history
--------------------------------+--------------------------------------
Reporter: Curtis Maloney | Owner: (none)
Type: New feature | Status: closed
Component: Migrations | Version: dev
Severity: Normal | Resolution: duplicate
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 Natalia Bidart):

* resolution: => duplicate
* status: new => closed
* type: Uncategorized => New feature
* version: 5.1 => dev

Comment:

Hello Curtis and David, thank you for your proposal and extra rationale.
This feels like a duplicate of #33421 which in turn is an "almost"
duplicate of #31504.

From looking at the code, the consistency check is skipped if the DB is
not available. I'll close as dupe, but please feel free to add further
rationale on either:

1. how this is different from the linked tickets, or
2. whether the solution provided in #31504 is not working for any reason.
--
Ticket URL: <https://code.djangoproject.com/ticket/35963#comment:2>
Reply all
Reply to author
Forward
0 new messages