If you look at the pyramid-cookiecutter-starter [1] the integration
modifies the env.py file to load the url from the app settings instead of
the alembic section of the ini. This allows you to put a copy-pasta
[alembic] section into the file which points at the migrations/slug
format/etc and
I think the basic idea is to create a database and codebase in the state of
the target revision. Then autogenerate a migration from nothing to that
revision - just like you would do when starting to use alembic from an
existing schema. From there you can change the slug on it so that it works
as
Presumably you do not have the pyramid_tm tween active in your pyramid
configuration which will perform commits at the end of requests:
config.include('pyramid_tm')
If you are running a script, you'd want to do your database actions inside
of a tm block:
with transaction.manager: