15 lines
513 B
Python
15 lines
513 B
Python
from sqlalchemy import Column, String, DateTime, UUID, ForeignKey
|
|
from sqlalchemy.orm import relationship
|
|
from uuid import uuid4
|
|
|
|
from models.base import Base
|
|
|
|
class Webhook(Base):
|
|
__tablename__ = "webhooks"
|
|
id = Column(UUID, primary_key=True, default=uuid4)
|
|
url = Column(String)
|
|
secret = Column(String)
|
|
team_id = Column(UUID, ForeignKey("teams.id"), nullable=False)
|
|
created_at = Column(DateTime)
|
|
updated_at = Column(DateTime)
|
|
team = relationship("Team", back_populates="webhooks") |