Automated Action b3827bf6b3 Add complete FastAPI delivery business backend
- Created customer, driver, and order models with SQLAlchemy
- Implemented CRUD API endpoints for all entities
- Set up SQLite database with Alembic migrations
- Added health check and base URL endpoints
- Configured CORS middleware for all origins
- Updated README with comprehensive documentation
2025-06-27 09:19:00 +00:00

17 lines
701 B
Python

from sqlalchemy import Column, Integer, String, DateTime, Text
from sqlalchemy.sql import func
from sqlalchemy.orm import relationship
from app.db.base import Base
class Customer(Base):
__tablename__ = "customers"
id = Column(Integer, primary_key=True, index=True)
name = Column(String(100), nullable=False)
email = Column(String(100), unique=True, index=True, nullable=False)
phone = Column(String(20), nullable=False)
address = Column(Text, nullable=False)
created_at = Column(DateTime(timezone=True), server_default=func.now())
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
orders = relationship("Order", back_populates="customer")