On Wednesday, September 9, 2015 at 9:21:43 PM UTC+10, Shai Berger wrote:
>
>
>
> On 9 בספטמבר 2015 13:29:58 GMT+03:00, Marten Kenbeek <marte...@gmail.com 
> <javascript:>> wrote: 
> > 
> >> 
> >> The order of migrations isn't something which is local to this 
> >feature, it 
> >> is something which isn't fixed (probably by design, correct me if I'm 
> > 
> >> wrong) and if it is not "the right way" to do it, maybe it should be 
> >part 
> >> of another issue. 
> > 
> > 
> >The order of migrations within a single app is fixed. 
>
> No, actually it isn't. It is only constrained by dependencies. Merge 
> migrations do not fix it either. The only thing they do is tell the 
> warning-happy migration system : "yes, I have considered the situation here 
> and it's OK to run these two migrations in either order ". 
>
No, they do ensure some sort of deterministic behavior. Migrations are 
sorted by their fully qualified name (tuple of (app_label, migration_name)):
https://github.com/django/django/blob/master/django/db/migrations/graph.py#L64

This behavior is enough for a 3rd party app to destroy the results of your 
own migration or the other way round.

Consider a.1 <-- a.2 <-- b.1 where b.1 makes changes to the app a. When the 
author of app a add another migration a.3 (a.1 <-- a.2 <-- (a.3, b.1)) the 
resulting order in which migrations are applied will be a.1, a.2, a.3, b.1. 
However, on an existing database, a.3 will be run after b.1, resulting in a 
non-deterministic order in which migrations for the same app are being 
applied.

Consider me a strengthened -1 looking at the discussion.

If we want to have something like "project level migrations" we should 
rethink a bunch of things, but that's out of scope of the initial proposal 
of this discussion, I think.

>
> Which raises two points : 
>
> First, can we (do we want to ) handle this validation some other way, and 
> would it buy us anything? 
>
> Second, how common is Marten's misconception? Do we need to address it? 
>
>
> Shai 
> -- 
> Sent from my Android device with K-9 Mail. Please excuse my brevity. 
>

/Markus 

-- 
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 http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c0de9532-5527-4ac5-9e6c-9a3475f9c342%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to