Skip to content

using x arguments breask when running a script #195

@sqlalchemy-bot

Description

@sqlalchemy-bot

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeasy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions