Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /ParisNeo_lollms /backend /db /models /discussion_group.py
| import uuid | |
| from sqlalchemy import ( | |
| Column, Integer, String, | |
| ForeignKey, | |
| DateTime, | |
| ) | |
| from sqlalchemy.sql import func | |
| from sqlalchemy.orm import relationship | |
| from backend.db.base import Base | |
| class DiscussionGroup(Base): | |
| __tablename__ = "discussion_groups" | |
| id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4())) | |
| name = Column(String, nullable=False) | |
| owner_user_id = Column(Integer, ForeignKey("users.id", ondelete="CASCADE"), nullable=False, index=True) | |
| parent_id = Column(String, ForeignKey("discussion_groups.id", ondelete="SET NULL"), nullable=True, index=True) | |
| created_at = Column(DateTime(timezone=True), server_default=func.now()) | |
| updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now()) | |
| owner = relationship("User", back_populates="discussion_groups") | |
| # Self-referential relationship | |
| parent = relationship("DiscussionGroup", remote_side=[id], back_populates="children") | |
| children = relationship("DiscussionGroup", back_populates="parent") |
Xet Storage Details
- Size:
- 1.07 kB
- Xet hash:
- 84122ebc8b8adcedf20ec76a616ece219197d2e57b839b69f0fcb5ef146bdf16
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.