addressing justcool393 comments

This commit is contained in:
Viet Than 2023-07-20 20:59:38 -04:00
parent 1e7a3d81b6
commit 57f6470c36
3 changed files with 22 additions and 17 deletions

View file

@ -33,7 +33,7 @@ class CommentFlag(CreatedDateTimeBase):
comment_id = Column(Integer, ForeignKey("comments.id"), nullable=False)
user_id = Column(Integer, ForeignKey("users.id"), nullable=False)
reason = Column(String)
Index('cflag_user_idx', user_id)
user = relationship("User", primaryjoin = "CommentFlag.user_id == User.id", uselist = False, viewonly=True)