Skip to content

Instantly share code, notes, and snippets.

@Filimoa
Created August 21, 2023 22:56
Show Gist options
  • Save Filimoa/f7a67de0d7b7d9c9693253f00a20a045 to your computer and use it in GitHub Desktop.
Save Filimoa/f7a67de0d7b7d9c9693253f00a20a045 to your computer and use it in GitHub Desktop.
Multiple Bases Getting Combined SqlAlchemy
from src.app.db.base import Base as AppBase # noqa
from src.b2b.db.base import Base as B2BBase # noqa
target_metadata = MetaData()
for table in AppBase.metadata.tables.values():
table.tometadata(target_metadata)
for table in B2BBase.metadata.tables.values():
table.tometadata(target_metadata)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment