add push notification support
This commit is contained in:
parent
6a69c5a34d
commit
1b1dcc3755
12 changed files with 175 additions and 10 deletions
|
|
@ -1,7 +1,7 @@
|
|||
from typing import Optional
|
||||
|
||||
from sqlalchemy import CHAR, String, TIMESTAMP, text
|
||||
from sqlalchemy.dialects.mysql import TINYINT
|
||||
from sqlalchemy import CHAR, Index, String, TIMESTAMP, text
|
||||
from sqlalchemy.dialects.mysql import INTEGER, TINYINT
|
||||
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
|
||||
import datetime
|
||||
|
||||
|
|
@ -9,6 +9,21 @@ class Base(DeclarativeBase):
|
|||
pass
|
||||
|
||||
|
||||
class AlertEndpoints(Base):
|
||||
__tablename__ = 'alert_endpoints'
|
||||
__table_args__ = (
|
||||
Index('ix_alert_endpoints_username', 'username'),
|
||||
Index('url', 'url', unique=True)
|
||||
)
|
||||
|
||||
id: Mapped[int] = mapped_column(INTEGER(11), primary_key=True)
|
||||
username: Mapped[Optional[str]] = mapped_column(String(64))
|
||||
url: Mapped[Optional[str]] = mapped_column(String(2048))
|
||||
auth: Mapped[Optional[str]] = mapped_column(String(2048))
|
||||
p256dh: Mapped[Optional[str]] = mapped_column(String(2048))
|
||||
created_at: Mapped[Optional[datetime.datetime]] = mapped_column(TIMESTAMP, server_default=text('current_timestamp()'))
|
||||
|
||||
|
||||
class Uploads(Base):
|
||||
__tablename__ = 'uploads'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue