How do I execute inserts and updates in an Alembic upgrade script?
What you are asking for is a data migration, as opposed to the schema migration that is most prevalent in the Alembic docs. This answer assumes you are using declarative (as opposed to class-Mapper-Table or core) to define your models. It should be relatively straightforward to adapt this to the other forms. Note that Alembic … Read more