#24100: Make `post_migrate` dispatch the migration plan.
-----------------------------+------------------------------------
Reporter: charettes | Owner: MarkusH
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Comment (by charettes):
> As for the ContentType renames, I think that perhaps it would be cleaner
to add signals for specific migration operations (such as RenameModel),
which get passed the two states of the migration and perform their
additional action (here, renaming the relevant ContentType entry), and
have contrib.contenttypes connect to that - rather than having it sift
through the whole plan itself. This way the change can also be done mid-
migration, and enable the rest of the migration to rely on a consistent
ContentType table.
The down side of basing the detection on `RenameModel` only is the fact we
don't handle any third party operation or usage of
`SeparateDatabaseAndState` that could also alter the model state.
I agree with you that `contrib.contenttypes` shouldn't have to figure out
which model were renamed from the plan by itself. Defining a ''utility''
function in the `migrations` module and using it the signal receiver would
make more sense.
--
Ticket URL: <https://code.djangoproject.com/ticket/24100#comment:10>
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/067.843519d00bd9ac9a2bba3beadec89052%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.