Using the SQLAlchemy ORM inside an Alembic migration: how do I?
After a bit of experimentation using @velochy’s answer, I settled on something like the following pattern for using SqlAlchemy inside Alembic. This worked great for me and could probably serve as a general solution for the OP’s question: from sqlalchemy.orm.session import Session from alembic import op # Copy the model definitions into the migration script … Read more