Skip to content
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
Closed

using x arguments breask when running a script #195

sqlalchemy-bot opened this issue Apr 4, 2014 · 3 comments
Labels
bug Something isn't working easy

Comments

@sqlalchemy-bot
Copy link

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
Copy link
Author

Michael Bayer (@zzzeek) wrote:

4e0b345

@sqlalchemy-bot
Copy link
Author

Changes by Michael Bayer (@zzzeek):

  • changed status to closed

@sqlalchemy-bot
Copy link
Author

Michael Bayer (@zzzeek) wrote:

thanks

@sqlalchemy-bot sqlalchemy-bot added bug Something isn't working easy labels Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working easy
Projects
None yet
Development

No branches or pull requests

1 participant