I'm running SA 1.0.5 w/Alembic 0.7.6. Alembic is new to me. I get this: (default-2.7)snafu$ alembic revision --autogenerate Traceback (most recent call last): File "/home/reece/.virtualenvs/default-2.7/bin/alembic", line 9, in <module> load_entry_point('alembic==0.7.6', 'console_scripts', 'alembic')() File "/home/reece/.virtualenvs/default-2.7/local/lib/python2.7/site-packages/alembic/config.py", line 439, in main CommandLine(prog=prog).main(argv=argv) File "/home/reece/.virtualenvs/default-2.7/local/lib/python2.7/site-packages/alembic/config.py", line 433, in main self.run_cmd(cfg, options) File "/home/reece/.virtualenvs/default-2.7/local/lib/python2.7/site-packages/alembic/config.py", line 416, in run_cmd **dict((k, getattr(options, k)) for k in kwarg) File "/home/reece/.virtualenvs/default-2.7/local/lib/python2.7/site-packages/alembic/command.py", line 113, in revision script.run_env() File "/home/reece/.virtualenvs/default-2.7/local/lib/python2.7/site-packages/alembic/script.py", line 390, in run_env util.load_python_file(self.dir, 'env.py') File "/home/reece/.virtualenvs/default-2.7/local/lib/python2.7/site-packages/alembic/util.py", line 243, in load_python_file module = load_module_py(module_id, path) File "/home/reece/.virtualenvs/default-2.7/local/lib/python2.7/site-packages/alembic/compat.py", line 79, in load_module_py mod = imp.load_source(module_id, path, fp) File "alembic/env.py", line 109, in <module> run_migrations_online() File "alembic/env.py", line 87, in run_migrations_online target_metadata=target_metadata.get(name) AttributeError: 'MetaData' object has no attribute 'get'
In my env.py: from uta.models import Base target_metadata = Base.metadata And uta/models.py contains: from sqlalchemy.ext.declarative import declarative_base Base = declarative_base( metadata=sa.MetaData(schema=schema_name) ) In other words, this all looks pretty vanilla to me and is based on the docs. Anyone recognized this error? Thanks, Reece -- You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy-alembic+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.