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

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/54985866.7040701%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to