add: webhook
This commit is contained in:
16
db/models/Webhook.py
Normal file
16
db/models/Webhook.py
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user