I'm attempting to configure SQLAlchemy Alembic for my Pyramid project and I want to use my developement.ini (or production.ini) for the configuration settings for Alembic. Is it possible to specify the .ini file I wish to use anywhere within Alembic?
Asked
Active
Viewed 7,593 times
2 Answers
30
Just specify alembic -c /some/path/to/another.ini
when running alembic commands. You could even put the [alembic]
section in your development.ini and production.ini files and just alembic -c production.ini upgrade head
.

Michael Merickel
- 23,153
- 3
- 54
- 70
-
Just as an addition, you MUST put the `-c /some/path/to/another.ini` BEFORE the commands or it gets confused. – AntonOfTheWoods Jun 12 '22 at 10:50
-
Also one might need to chnage the `script_location` in the `alembic.ini` as well – Charalamm Feb 03 '23 at 09:21
0
in many cases you can also use one shared alembic.ini and dynamically compute some parts somewhere else and interpolate them into the alembic.ini via %(VARIABLE)s
replacements. see https://stackoverflow.com/a/55190497/2536029 for a complete description.

mnagel
- 6,729
- 4
- 31
- 66