[Django] #36303: Add ghost migrations warning to runserver

7 views
Skip to first unread message

Django

unread,
Apr 7, 2025, 9:40:34 AMApr 7
to django-...@googlegroups.com
#36303: Add ghost migrations warning to runserver
---------------------------------------+-----------------------------
Reporter: Jacob Walls | Owner: Jacob Walls
Type: New feature | Status: assigned
Component: Migrations | Version: dev
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 |
---------------------------------------+-----------------------------
On the [https://forum.djangoproject.com/t/check-for-ghost-migrations-
opposite-of-you-have-n-unapplied-migration-s/38657 forum], several folks
indicated interest in supplementing the runserver warning about missing
migrations with a warning for "ghost" migrations: migrations recorded on
the database but not present on disk, presumably as a consequence of
switching away from a feature branch under development.

I suggested wording along the lines of:
{{{
The following migrations are recorded as applied but no longer exist in
your project:

Your project may not work correctly if they are reversible and are
intended to be reversed.
To reverse the migrations, recover them (e.g. by switching branches) and
run:
“manage.py migrate <app_name> <last_migration_on_disk>”
If you are certain the migrations do not need to be reversed, run:
“manage.py migrate <app_name> --prune” to remove references to them.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36303>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 8, 2025, 11:31:40 AMApr 8
to django-...@googlegroups.com
#36303: Add ghost migrations warning to runserver
-----------------------------+---------------------------------------
Reporter: Jacob Walls | Owner: Jacob Walls
Type: New feature | Status: closed
Component: Migrations | Version: dev
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 Natalia Bidart):

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

Comment:

Hello Jacob, thanks so much for creating this ticket as a follow-up of the
forum thread. I have read the posts and while I understand the goal, I'm
not sure there is a clear consensus about having this feature. My main
concern is not so much about "votes" (no one has objected), but I fear
different users have posted favored slightly different features.
Specifically, no one replied to your `--prune` question and I'm very
interested in following up that lead.

I'll be closing as `wontfix` for now but I will comment on the forum to
get a clearer idea of what would be the specific feature we would commit
to maintain. I'll be happy to reopen and accept once we have more concrete
details.
--
Ticket URL: <https://code.djangoproject.com/ticket/36303#comment:1>

Django

unread,
Apr 8, 2025, 2:40:57 PMApr 8
to django-...@googlegroups.com
#36303: Add ghost migrations warning to runserver
-----------------------------+---------------------------------------
Reporter: Jacob Walls | Owner: Jacob Walls
Type: New feature | Status: closed
Component: Migrations | Version: dev
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 Natalia Bidart):

* cc: Simon Charette, David Sanders (added)

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

Django

unread,
Apr 8, 2025, 2:58:30 PMApr 8
to django-...@googlegroups.com
#36303: Add ghost migrations warning to runserver
-----------------------------+---------------------------------------
Reporter: Jacob Walls | Owner: Jacob Walls
Type: New feature | Status: closed
Component: Migrations | Version: dev
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 Natalia Bidart):

* cc: Andrew Godwin (added)

Comment:

Adding some folks for more awareness.
--
Ticket URL: <https://code.djangoproject.com/ticket/36303#comment:3>
Reply all
Reply to author
Forward
0 new messages