Do i want to use bases or branches or something else?

11 views
Skip to first unread message

Jonathan Vanasco

unread,
Feb 5, 2020, 12:42:58 PM2/5/20
to sqlalchemy-alembic
I'd like to integrate Alembic into a project that is mostly driven by the Pyramid framework.

In my use-case, Pyramid is driven by two or more different configuration files, such as:

    example_development.ini
    example_production.ini

The relevant difference between them is the sqlalchemy url - which can point to different databases and even different database drivers.  Then there are the test systems.

What is the most-correct/easiest/best way of integrating alembic in this situation? 

Is it possible to somehow declare the sqlalchemy url in the my pyramid .ini files, then have a single simple alembic file reference that?

Michael Merickel

unread,
Feb 5, 2020, 1:11:33 PM2/5/20
to sqlalchem...@googlegroups.com
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 sources the url from elsewhere.


--
You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy-alem...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy-alembic/9258400f-d23b-4c92-856e-cba8c74dacf6%40googlegroups.com.


--

Michael
Reply all
Reply to author
Forward
0 new messages