16 lines
455 B
Python
16 lines
455 B
Python
|
|
from sqlalchemy import Column, String, Integer, ForeignKey, UniqueConstraint, text, Boolean
|
|
from db.models import Base
|
|
|
|
|
|
class Webhook(Base):
|
|
__tablename__ = 'webhook'
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
hook_url = Column(String(100), nullable=False)
|
|
__table_args__ = (UniqueConstraint('hook_url'),)
|
|
|
|
def to_dict(self):
|
|
return {
|
|
"id": self.id,
|
|
"hook_url": self.hook_url
|
|
} |