Hi Marcin,
On 12/22/2014 10:28 AM, Marcin Nowak wrote:
>> This is not an optional contrib add-on, it's a core part of the ORM.
>
> There are systems where Django is not a core, but it is used as lightweight
> app server.
> Database schema migrations are created and executed in the other way..
> That's why is so important to not change any database schema.
Yes - that's precisely the scenario for which managed=False is intended.
>> That said, if you don't want to use migrations, you don't have to
>
>
> Yes, of course. But somebody can still hit <enter> after "migration"
> command and execute something very bad.
> To prevent mistakes like this I would like to disable migrations for
> specified databases or for whole Django-based project.
If you set managed=False on the models, no such mistake can occur.
>> That's what setting `managed = False` on the `Meta` of all your models
>> will accomplish.
>>
>>
> Yes, I'll try this.
> It should help me in my case, but this is not same as bypassing migrations
> subsystem.
> Built-in migrations should be optional.
I'm not sure I understand what you mean by "bypassing migrations
subsystem", then. Setting managed=False is the same as bypassing migrations.
Either some other system is responsible for creating and maintaining
database schema, or Django is responsible for it.
If some other system is responsible (as in your case), then you should
use managed=False and Django will not touch the db schema, ever.
If Django is responsible (as for most users), then migrations are now
the _only_ (non-deprecated) method Django uses to create or modify
database schema.
The one feature I can see that might be missing is a way to set the
equivalent of managed=False globally, so that it also applies to
third-party apps (without having to monkeypatch them).
Carl