
- User authentication with JWT tokens (register/login) - Tutor session management with CRUD operations - Message tracking for tutor conversations - SQLite database with Alembic migrations - CORS configuration for frontend integration - Health check and service info endpoints - Proper project structure with models, schemas, and API routes
16 lines
639 B
Python
16 lines
639 B
Python
from sqlalchemy import Column, Integer, Text, DateTime, String, ForeignKey
|
|
from sqlalchemy.sql import func
|
|
from sqlalchemy.orm import relationship
|
|
from app.db.base import Base
|
|
|
|
|
|
class TutorMessage(Base):
|
|
__tablename__ = "tutor_messages"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
session_id = Column(Integer, ForeignKey("tutor_sessions.id"), nullable=False)
|
|
message_type = Column(String, nullable=False) # "user" or "tutor"
|
|
content = Column(Text, nullable=False)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
|
|
session = relationship("TutorSession", back_populates="messages") |