Fix migrations for Python 2