Make migrations upgrade safe.
Adds some more upgrade tasks.