Wednesday, August 26, 2015

Re: Turn off migrations completely in Django 1.7

Hi Grzegorz,

On Aug 26, 2015, at 2:25 AM, Grzegorz Stalmierski <grzegorz.stalmierski@gmail.com> wrote:

W dniu 25.08.2015 o 19:04, Marcin Nowak pisze:

I would like to provide solid patch as a pull request, but I'm afraid that it will be rejected due to some kind of spirit, politics or something else. 

BR,
Marcin
Marcin, please - consider sharing your patch on GitHub (or similar)
with a documentation, because:
It is not possible to build a framework where _everything_ is easy. We  aim for "Simple things should be easy, advanced things should be possible."    Carl
this is not so advanced thing, and it looks almost
impossible to solve in Django.
With current architecture around migrations Django
is database owner, not one of the database services.


I agree, and I already suggested a new feature (`managed=False` at the AppConfig level) for which I think a solid patch would most likely be accepted. This new feature would be capable of handling the "don't migrate anything" case as well as the wide variety of "migrate these apps but not those" cases. 

You quoted me out of context. My quote was in reply to Marcin complaining that even _that_ feature would still be too much work to use. I wasn't claiming the status quo is sufficient for this. 

FWIW I don't think a single new setting to switch off migrations for all apps is 100% out of the question, if it turns out there are a number of people who would use it. I'd like to hear a little more specifics from such people about their use case. I don't think a global flag is as generally useful as the above feature, and it would need to come with some pretty strong warnings in the docs. For instance, Django may modify models in contrib apps and ship migrations for them in future versions, and of course third party apps will commonly do the same. So anyone using such a global flag is accepting responsibility for watching out for such schema changes themselves, or their project may break when they upgrade Django or another app. 

Carl

No comments:

Post a Comment