Reputation: 12378
I have read that one should flatten (South) migrations before pushing new code to production. What does "flatten migrations" mean, why is it recommended, and how is it done in South?
Upvotes: 3
Views: 1678
Reputation: 47172
What flattening migrations means is basically just chunking all of the migrations together as to reduce runtime of the migrations when migrations grow fairly large. It's possible but not recommended since you'll be losing all of your migration history effectively making each and every migration you run start from 0.
I haven't read anywhere that flattening is "recommended" so I can't give you that piece of advice, if you have a link I'd be happy to read it.
I have read that Ruby on Rails have this functionality but it isn't recommended there either.
Consider these questions first:
If this is done to hinder any missing or out of order migrations I would use
python manage.py schemamigration myapp --merge
or last but not least update the latest migration using --update
I found this question whilst googling and thought it'd be good for reference, it in turn contains links to 4 other questions.
Upvotes: 3