keeai / app /models /student_comment.py
Seth0330's picture
Create student_comment.py
5935901 verified
raw
history blame contribute delete
751 Bytes
# app/models/student_comment.py
from datetime import datetime
from sqlalchemy import (
Column,
Integer,
String,
Text,
DateTime,
ForeignKey,
)
from sqlalchemy.orm import relationship
from core.database import Base
class StudentComment(Base):
__tablename__ = "student_comments"
id = Column(Integer, primary_key=True, index=True)
student_id = Column(
Integer,
ForeignKey("students.id"),
nullable=False,
index=True,
)
coach_email = Column(String(255), nullable=False)
comment = Column(Text, nullable=False)
created_at = Column(DateTime, default=datetime.utcnow)
# Relationship
student = relationship("Student", back_populates="comments")