#25231: Incomplete Fix for #24628 - Squashed Migration Still Not Marked as
Applied
-------------------------------+--------------------
Reporter: mlavin | Owner: nobody
Type: Uncategorized | Status: new
Component: Migrations | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
I'm still seeing this behavior in 1.8.3 so I believe that this fix is
incomplete. The problem with the original fix is that it relies on the
{{{executor.migrate}}} method being called. While that is done by the
tests, it isn't when following the workflow described in the docs. When
you call the {{{migrate}}} management command, it first checks the
migration plan to see if any migrations need to be run. Since the
migration plan sees the replacement migration as already applied there is
no plan (assuming there are no other unapplied migrations) and the
{{{executor.migrate}}} is never called. In this case the replacement
migration is never recorded as applied. Then when the old migrations are
removed and the {{{replaces}}} attribute is removed, the {{{migrate}}}
command attempts to run the squashed migration which fails since the
tables, etc already exist.
--
Ticket URL: <https://code.djangoproject.com/ticket/25231>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.04e4e0cc2c0ea1d4759a595025f46ade%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.