On Mar 26, 2012, at 12:46 PM, John Anderson wrote:
> I have some models stored in a library that have their own declarative base
> and then my apps models that use their own.
>
> So instead of defining a single Metadata target for the migration I need to
> send a list of them for it to check on.
>
> Is this possible?
>
> As an example of what I need, here is the populate script I currently use:
> session = DBSession(bind=engine)
> Entity.metadata.drop_all(engine)
> SUEntity.metadata.drop_all(engine)
>
> SUEntity.metadata.create_all(engine)
> Entity.metadata.create_all(engine)
Probably a feature Alembic could support. For now you'd need to merge them:
m = MetaData()
for t in Entity.metadata.tables.values():
t.tometadata(m)
for t in SUEntity.metadata.tables.values():
t.tometadata(m)
but would be more efficient if Alembic just let you pass multiple metadatas.
https://bitbucket.org/zzzeek/alembic/issue/38/allow-multiple-metadata-objects-for
is added
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.