Issues

Issue #38 new

allow multiple metadata objects for autogenerate

Mike Bayer
repo owner created an issue

No description provided.

Comments (7)

  1. buddyteal7

    It is very common to have multiple models and many tables. This feature seems quite important. I'm surprised more people haven't run in to this issue.

  2. Mike Bayer reporter

    Currently I'm working around it roughly like this:

    our_metadata = MetaData()
    for metadata in (m1, m2, m3):
        for t in metadata.tables.values():
             if _your_check_here(t):
                t.tometadata(our_metadata)
    
  3. buddyteal7

    I have a few questions about your work around:

    Are you using this work around in env.py and setting the value of target_metadata? Or is this used somewhere separate?

    Where is MetaData() being defined?

    t.tometadata(our_metadata) - not sure how this is working or what is actually getting set.

    I really like alembic and would love to get it working with multiple models.

  4. Log in to comment