Shai, I think I have a viable solution for the the second kind of data migration your are mentioning.
https://code.djangoproject.com/ticket/26064#ticket Simon Le samedi 9 janvier 2016 11:30:01 UTC-5, Shai Berger a écrit : > > On Saturday 09 January 2016 04:56:11 'Hugo Osvaldo Barrera' via Django > developers (Contributions to Django itself) wrote: > > > > In my case, once data migrations have run in staging/production, they're > > useless and can be ignored forever, so there's no point in keeping them > > in later squashed migrations months later. > > > > There are two kinds of data migrations, generally speaking. > > One is the kind that is needed to facilitate some schema migrations. > Changing > the type of some field, for example, usually involves creating the new > field > (schema migration), transforming the data from the old field to the new > (data), > and then removing the old field (and perhaps some renaming; schema). This > kind > of migrations, indeed, can be just removed when squashing. > > The other is migrations which *create* data -- fill in tables for > database- > implemented-enums, for example. If you remove these, you are going to > break > your tests (if you do this and haven't broken your tests, your tests are > missing -- I'd go as far as calling them broken). > > The second kind is quite common. Having a built-in command that resets > migrations and ignores them is, IMO, encouragement to skip testing, and I > think we shouldn't do that. Some notion (as Carl, I think, mentioned) of > "squashable data migrations" -- essentially, telling the two kinds apart > -- > would be helpful. but not solve the problem completely, because, > ultimately, > the second kind exists. We need to figure out how to help users deal with > them. > > Shai. > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/5c2b53b3-7d80-4313-a7bb-5bb875a6ef66%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.