Spaces:
No application file
No application file
File size: 461 Bytes
a0c847a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, func
from sqlalchemy.orm import relationship
from app.database import Base
class ChatHistory(Base):
__tablename__ = "chat_history"
id = Column(Integer, primary_key=True, index=True)
user_id = Column(Integer, ForeignKey("users.id"))
message = Column(String)
response = Column(String)
timestamp = Column(DateTime, default=func.now())
user = relationship("User")
|