I\'m using Alembic with SQL Alchemy. With SQL Alchemy, I tend to follow a pattern where I don\'t store the connect string with the versioned code. Instead I have file secr
secr
In env.py just add
env.py
config.set_main_option('sqlalchemy.url', os.environ['DB_URL'])
after
config = context.config
like
config = context.config config.set_main_option('sqlalchemy.url', os.environ['DB_URL'])
and then execute like that:
DB_URL="mysql://atuamae:de4@127.0.0.1/db" \ alembic upgrade head