#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:  Accepted
  migration,models,mixin,postgresql  |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Shai Berger):

 My first reaction, when I saw this ticket, was to think that it's invalid:
 Once you have a migration that uses some code construct -- a function or a
 base-class -- that code should not change, as changing it in any
 significant way undermines the idea that migrations recreate the models as
 they were at the time the migration was generated.

 However, that's not what our docs say -- the
 [https://docs.djangoproject.com/en/1.11/topics/migrations/#historical-
 models docs] only say that the function or class needs "to be kept
 around", not that it needs to be kept unchanged.

 That said, I still don't think Django should support such changes, other
 than to flag them as errors.

 **That** said, I'm not sure if there's any reasonable way to detect these
 situations automatically.

 Either way, I think we should fix the docs.

 #23521 may be related, but I don't think it's a duplicate, as the use-case
 described there is an intended one.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28438#comment:9>
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.d39181ab33839f36c68c281a7851abaf%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to