Re: Some thoughts about improving migration squashing

2017-02-16 Thread raphael
Hey Simon, I looked through your PR and added a couple comments. The main thing is I think we can actually ignore the field context on "RemoveField", if only because the executor doesn't need it. Even though the field might be pointing to a related model, that doesn't prevent being optimized

Re: Some thoughts about improving migration squashing

2017-02-16 Thread Markus Holtermann
I'm not sure if it's related or not wo what you're investigating, RemoveField cannot "just" optimized through, as you might have another AddField operation afterwards adding another field with the same name. /Markus On Thu, Feb 16, 2017 at 08:19:01AM -0800, raph...@makeleaps.com wrote: Hey Simo

Re: Some thoughts about improving migration squashing

2017-02-16 Thread raphael
When you have AddField('A', 'foo', ForeignKey('B')), this operation references A and foo, but also references B. RemoveField('A', 'foo') also references A and foo, but does it reference B? if it does, then it' s hard to have optimizations that pass through this, because this field could be ref

Re: Proposal to merge django-csp into contrib

2017-02-16 Thread Robert Roskam
OK, I'll probably hold off for a little bit just in case someone else wants it. But I'll probably have some time soon to work on it. Robert Roskam On Wednesday, February 15, 2017 at 9:13:45 PM UTC-5, Tim Graham wrote: > > Yes, if a ticket goes weeks or months without activity, it's unlikely > s

Re: Proposal to merge django-csp into contrib

2017-02-16 Thread Thomas Grainger
I'd like to see this happen! Don't worry about taking over from me! On 17 Feb 2017 00:37, "Robert Roskam" wrote: > OK, I'll probably hold off for a little bit just in case someone else > wants it. But I'll probably have some time soon to work on it. > > Robert Roskam > > On Wednesday, February 1

Re: Some thoughts about improving migration squashing

2017-02-16 Thread charettes
> RemoveField('A', 'foo') also references A and foo, but does it reference B? if it does, then it' s hard to have optimizations that pass through this, because this field could be referencing any model (theoretically). I think we all agree on that. > But if we assert that RemoveField doesn't re

Re: Some thoughts about improving migration squashing

2017-02-16 Thread Gaschignard, Raphael
Hi Simon, I think it's a bit more general than that. Why does the `RemoveField` exist? Because somewhere, an `AddField`-esque operation exists before it, right? Let's say we have m, m' as models. Let -F be a RemoveField(m, 'foo', ForeignKey(m') operation. We also have two operations +M',

Re: Some thoughts about improving migration squashing

2017-02-16 Thread Gaschignard, Raphael
To clarify on my previous post, if we're in the first case, then the +M and -F operations can be optimized in one path to remove the dependency, and then the +M' and -M' operation can be optimized through. In the second case (with an AddField operation), the +F and -F operations will cancel each o