jeudi 16 juillet 2015

Database Upgrade with SqlAlchemy Migrate or Alembic


In a previous "Database Upgrade with SqlAlchemy Migrate" I was more in favour of SqlAlchemy Migrate because you strictly control the content of the upgrade.

So, today, I did start to look for the SqlAlchemy-Migrate documentation and realize that this project development is now stopped.
By browsing the Net for "Migrate under Python 3" (which doesn't exist so forth), I did find the article "Flask-Migrate: Alembic database migration wrapper for Flask" from Flask Mega Tutorial by Miguel Grinberg.

There I learned that Alembic is still actively maintained and documented by Mike Bayer (the author of SqlAlchemy). No body want to start a development upon a deprecated tools... so I have no more choice than selecting Alembic.
Finally, while reading the Miguel's article, I did learn that we should review the migration script because Alembic doesn't take care about information like Indexes and stuff like that.