-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
questions about the alembic. #61
Comments
With SQLAlchemy Core, I just store all models in Separation by |
I created a models registry.
and inside alembic
|
I use a variant of the approaches in the previous responses, where I create a from sqlalchemy import MetaData
metadata = MetaData(naming_convention=DB_NAMING_CONVENTION)
class Base(MappedAsDataclass, AsyncAttrs, DeclarativeBase):
metadata = metadata i use this from src.auth.models import Base as AuthBase
__all__ = ["AuthBase"] this ensures the models in the imported then in alembic from src.database import metadata
target_metadata = metadata |
If there's a models file inside each app as shown in the structure, how can I configure env.py or databases.py so that Alembic can detect all the tables in those models.py files? Currently, I'm manually importing each models file in env.py.
The text was updated successfully, but these errors were encountered: