Re: A command to optimize a squashed migration?

2016-10-31 Thread Andrew Godwin
I would say that a command to re-optimise a single migration would be a
good idea, especially since it needs no changes to the stored set of run
migrations since it would theoretically do the same thing.

Andrew

On Mon, Oct 31, 2016 at 1:58 PM, Shai Berger  wrote:

> Hi,
>
> I'm doing some migration squashing, which was long overdue; so, I'm
> squashing
> dozens of migrations at once. Within these migrations, there are data
> migrations (RunPython operations) which, of course, stand as barriers to
> optimization. The operations have not been defined elidable -- because we
> are
> still on Django 1.8. So, after squashing, I go over the operations one by
> one,
> find that they are indeed elidable, and delete them. Which leaves me with a
> sub-optimized squashed migration.
>
> This got me thinking, though, about our solution to the situation in
> general:
> If I were on Django 1.10, I could probably solve my problem by changing the
> original operations to elidable, and then running squashmigration again.
> But
> does this solve all cases? Wouldn't we like a way to take a hand-edited
> migration, squashed or otherwise, and optimize it?
>
> For the record, the optimizing command was suggested, under the name
> "resquash", by Piotr Maliński[1]. The suggestion didn't really get a lot of
> traction, and as mentioned, the "elidable" flag solves a big part of the
> problem, if not all of it.
>
> Thoughts?
>
> Thanks,
> Shai.
>
>
> [1] https://groups.google.com/d/msg/django-developers/vtf-4II-
> rEo/OIA1Sdsnm6oJ
>
> --
> 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 https://groups.google.com/group/django-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-developers/201610311558.10025.shai%40platonix.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAFwN1urBjOd3FHeY9odGfVC-xM6KJVpSNDFoCvgrMVQ%3D8g6S6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


A command to optimize a squashed migration?

2016-10-31 Thread Shai Berger
Hi,

I'm doing some migration squashing, which was long overdue; so, I'm squashing 
dozens of migrations at once. Within these migrations, there are data 
migrations (RunPython operations) which, of course, stand as barriers to 
optimization. The operations have not been defined elidable -- because we are 
still on Django 1.8. So, after squashing, I go over the operations one by one, 
find that they are indeed elidable, and delete them. Which leaves me with a 
sub-optimized squashed migration.

This got me thinking, though, about our solution to the situation in general: 
If I were on Django 1.10, I could probably solve my problem by changing the 
original operations to elidable, and then running squashmigration again. But 
does this solve all cases? Wouldn't we like a way to take a hand-edited 
migration, squashed or otherwise, and optimize it?

For the record, the optimizing command was suggested, under the name 
"resquash", by Piotr Maliński[1]. The suggestion didn't really get a lot of 
traction, and as mentioned, the "elidable" flag solves a big part of the 
problem, if not all of it.

Thoughts?

Thanks,
Shai.


[1] https://groups.google.com/d/msg/django-developers/vtf-4II-rEo/OIA1Sdsnm6oJ

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/201610311558.10025.shai%40platonix.com.
For more options, visit https://groups.google.com/d/optout.