Fix: add IssueComment model
This commit is contained in:
parent
0d1fc78d2d
commit
48bfb0f618
|
|
@ -64,3 +64,16 @@ class Issue(Base):
|
|||
# Relations
|
||||
organization = relationship("Organization", back_populates="issues")
|
||||
integration = relationship("Integration", back_populates="issues")
|
||||
comments = relationship("IssueComment", back_populates="issue", cascade="all, delete-orphan")
|
||||
|
||||
class IssueComment(Base):
|
||||
__tablename__ = "issue_comments"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
issue_id = Column(Integer, ForeignKey("issues.id"), nullable=False)
|
||||
user_id = Column(Integer, ForeignKey("users.id"), nullable=True)
|
||||
content = Column(Text, nullable=False)
|
||||
created_at = Column(DateTime, default=datetime.utcnow)
|
||||
|
||||
# Relations
|
||||
issue = relationship("Issue", back_populates="comments")
|
||||
|
|
|
|||
Loading…
Reference in New Issue