Should squashmigrations produce a migration that could be improved by editing?

29 views
Skip to first unread message

Andrew Farrell

unread,
Apr 17, 2015, 6:03:50 PM4/17/15
to django...@googlegroups.com
Hi Folks,

I recently squashed 93 migrations down to 1 in order to improve the speed at which tests ran. (5 tests took about 70 seconds to run before. Now they take 13.) I noticed that the resulting migration had a large list of small operations, mostly migration.AddField. What I have two questions:

1) Is it likely worth the effort to decrease the time it takes for the test runner to spin up the test database by pushing these operations into just a few and are there any tripwires I should be aware of in doing so? 

2) I did need to re-order two CreateModel operations in order to get this migration to run because a model was created before one on which it had a ForeignKey relation. I suspect this of being a bug someone would have run into already but a couple searches show one hasn't been filed don't turn up anything. Does this sound familiar to anyone or should I file a new ticket?


This project is currently running
python=2.7.9
django==1.7.7

cheers,
Andrew
Reply all
Reply to author
Forward
0 new messages