Migrated issue, originally created by Ronny Pfannschmidt (@RonnyPfannschmidt)
when using a config instance from a script,
i noticed that the get_x_argument function expects conig.cmd_opts never to be None
i had to insert a dummy objects in its place with a x attribute set to none to make my scrpt work
def run_upgrade():
from alembic.config import Config
from alembic import command
config = Config('alembic.ini')
class Dummy(object):
x = None
config.cmd_opts = Dummy()
config.set_main_option('sqlalchemy.url', str(_build_sa_url()))
command.upgrade(config, 'head')
Session.remove()
Migrated issue, originally created by Ronny Pfannschmidt (@RonnyPfannschmidt)
when using a config instance from a script,
i noticed that the get_x_argument function expects conig.cmd_opts never to be None
i had to insert a dummy objects in its place with a x attribute set to none to make my scrpt work