import uuid from sqlalchemy import Column, String, DateTime, ForeignKey from sqlalchemy.sql import func from sqlalchemy.orm import relationship from app.core.database import Base class Mention(Base): __tablename__ = "pjctrl_mentions" id = Column(String(36), primary_key=True, default=lambda: str(uuid.uuid4())) comment_id = Column(String(36), ForeignKey("pjctrl_comments.id", ondelete="CASCADE"), nullable=False) mentioned_user_id = Column(String(36), ForeignKey("pjctrl_users.id"), nullable=False) created_at = Column(DateTime, server_default=func.now(), nullable=False) # Relationships comment = relationship("Comment", back_populates="mentions") mentioned_user = relationship("User", back_populates="mentions")