Automated Action f14ce141af Fix database migration error related to app module imports
- Fixed circular import issue between base.py and base_class.py
- Updated base_class.py to define Base directly and import models
- Refactored base.py to import Base from base_class.py
- Updated all models to import Base from base_class.py
- Enhanced error handling in migrations/env.py to catch ImportError
2025-06-12 17:46:42 +00:00

12 lines
396 B
Python

# Import all the models, so that Base has them before being
# imported by Alembic
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
# Import models to register them with Base
from app.models.user import User # noqa
from app.models.product import Product # noqa
from app.models.order import Order, OrderItem # noqa
from app.models.cart import CartItem # noqa