init: Initial commit
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
from sqlalchemy import Column, String, DateTime, UUID
|
||||
from sqlalchemy import Column, String, DateTime, UUID
|
||||
from sqlalchemy.orm import relationship
|
||||
from uuid import uuid4
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from models.base import Base
|
||||
|
||||
class Team(Base):
|
||||
__tablename__ = "teams"
|
||||
id = Column(UUID, primary_key=True, default=uuid4)
|
||||
name = Column(String)
|
||||
microsoft_team_id = Column(UUID)
|
||||
created_at = Column(DateTime)
|
||||
updated_at = Column(DateTime)
|
||||
webhooks = relationship("Webhook", back_populates="team", cascade="all, delete-orphan")
|
||||
microsoft_team_id = Column(UUID, nullable=False, unique=True)
|
||||
created_at = Column(DateTime, default=datetime.now)
|
||||
updated_at = Column(DateTime, default=datetime.now)
|
||||
|
||||
channels = relationship("Channel", back_populates="team", cascade="all, delete-orphan")
|
||||
Reference in New Issue
Block a user