Same here. Our backend team uses Python, SQLAlchemy and PG. They are looking for a tool to handle migrations and schema versionings. Any recommendations?
Alembic. It's made by zzzeek (Mike Bayer), who created SQLA and it's hackable to do custom migrations.
We use it by changing the models in code and then having Alembic automatically create a suitable migration for us. Then we change the migration as required (adding steps for data migrations etc). It's really simple:
We use it by changing the models in code and then having Alembic automatically create a suitable migration for us. Then we change the migration as required (adding steps for data migrations etc). It's really simple:
That generates a python file with an upgrade and downgrade function. You can then customise fully as you require.Then on the db server you can run: