Automated Action 11ef92d44e Fix circular import issue in database models
- Created a dedicated base_class.py file to define the SQLAlchemy Base
- Updated all models to import Base from base_class.py instead of session.py
- Modified migrations/env.py to properly import models and Base
- Fixed circular dependency between models and base classes
2025-06-02 22:08:10 +00:00

10 lines
374 B
Python

# Import all the models, so that Base has them before being
# imported by Alembic
from app.db.base_class import Base # noqa
# Import all the models to ensure they are registered with SQLAlchemy
from app.models.user import User # noqa
from app.models.post import Post # noqa
from app.models.comment import Comment # noqa
from app.models.tag import Tag, post_tag # noqa