Fwiw I think by default it could/should try to optimize all migrations of 
an app, manually specifying the migration name should be optional.

On Wednesday, February 15, 2017 at 2:00:54 PM UTC+1, rap...@makeleaps.com 
wrote:
>
> I ended up having some time today, so wrote up a management command for 
> the first suggestion!
>
> I called it "optizemigration"
>
>
> >>> ./manage.py optimizemigration appname 0001_squashed
>   # snipped django startup noise
>   Optimized from 9 operations to 4 operations
>
> Optimized migration /Users/rtpg/proj/projname/projname/appname/migrations/
> 0001_squashed_20170215.py
>
>
> This reads in the migration file, runs the migration optimizer, and then 
> outputs to the same file. Writing it has paid off almost immediately for me.
>
> Those who are interested can take a look here 
> <https://github.com/rtpg/django/blob/optimizemigration/django/core/management/commands/optimizemigration.py>
> .
>
> How much testing/coverage requirements are there for management commands 
> like these?
>
>
>

-- 
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/6055f360-b916-4bd3-8b9a-eea3768c1241%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to