New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using x arguments breask when running a script #195

Closed
sqlalchemy-bot opened this Issue Apr 4, 2014 · 3 comments

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented Apr 4, 2014

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()
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Apr 4, 2014

Michael Bayer (@zzzeek) wrote:

  • Fixed bug where :meth:.EnvironmentContext.get_x_argument
    would fail if the :class:.Config in use didn't actually
    originate from a command line call. fixes #195

4e0b345

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Apr 4, 2014

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Apr 4, 2014

Michael Bayer (@zzzeek) wrote:

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment