Automated Action 4458f5320b Build e-commerce API with FastAPI and SQLite
- Implemented user authentication with JWT tokens
- Created product management endpoints
- Added shopping cart functionality
- Implemented order management system
- Setup database models with SQLAlchemy
- Created alembic migrations
- Added health check endpoint

generated with BackendIM... (backend.im)
2025-05-13 22:46:42 +00:00

15 lines
443 B
Python

from sqlalchemy import Column, Integer, DateTime
from sqlalchemy.sql import func
from app.db.session import Base
class TimestampMixin:
created_at = Column(DateTime(timezone=True), server_default=func.now())
updated_at = Column(
DateTime(timezone=True), server_default=func.now(), onupdate=func.now()
)
class BaseModel(Base, TimestampMixin):
__abstract__ = True
id = Column(Integer, primary_key=True, index=True)