#28438: Initial migration creates fields not listed in the migration if mixin
class
changes
-------------------------------------+-------------------------------------
Reporter: Michal Dabski | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage:
migration,models,mixin,postgresql | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Michal Dabski):
At this point my code has been deployed to production with mixin
inheriting from object. I use mixin to reuse code across two models that
have separete hierarchy trees, so common base class was not an option.
At the moment my best workaround is to keep the mixin as-is, and add a
field to each subclass as needed, but that violates separation of concerns
principle and DRY.
I have seen mixin pattern being used in models in Django itself, so I
think it should be OK to use mixins. For example, {{{PermissionMixin}}}
class. The only difference is that my mixin used to inherit from
{{{object}}} originally, which was recorded by the initial migration.
--
Ticket URL: <https://code.djangoproject.com/ticket/28438#comment:6>
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/064.961db01542306d19204b30bb595eda4f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.