Seth0330 commited on
Commit
5935901
·
verified ·
1 Parent(s): 1197a8c

Create student_comment.py

Browse files
Files changed (1) hide show
  1. app/models/student_comment.py +35 -0
app/models/student_comment.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # app/models/student_comment.py
2
+ from datetime import datetime
3
+
4
+ from sqlalchemy import (
5
+ Column,
6
+ Integer,
7
+ String,
8
+ Text,
9
+ DateTime,
10
+ ForeignKey,
11
+ )
12
+ from sqlalchemy.orm import relationship
13
+
14
+ from core.database import Base
15
+
16
+
17
+ class StudentComment(Base):
18
+ __tablename__ = "student_comments"
19
+
20
+ id = Column(Integer, primary_key=True, index=True)
21
+
22
+ student_id = Column(
23
+ Integer,
24
+ ForeignKey("students.id"),
25
+ nullable=False,
26
+ index=True,
27
+ )
28
+
29
+ coach_email = Column(String(255), nullable=False)
30
+ comment = Column(Text, nullable=False)
31
+
32
+ created_at = Column(DateTime, default=datetime.utcnow)
33
+
34
+ # Relationship
35
+ student = relationship("Student", back_populates="comments")