On 6/16/15 5:17 PM, Reece Hart wrote:
I'm running SA 1.0.5 w/Alembic 0.7.6. Alembic is new to me. I get this:


this line here:

  File "alembic/env.py", line 87, in run_migrations_online
    target_metadata=target_metadata.get(name)

is part of something that was coded on your end, because it is in env.py. The MetaData object doesn't have a get() method. It does have a ".tables" dictionary from which you can call get(), however, but that would return a Table object, not a MetaData object.

So you'd need to fix your env.py here.



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 [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to