You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
677 B
18 lines
677 B
from flask_sqlalchemy import SQLAlchemy
|
|
|
|
db = SQLAlchemy()
|
|
|
|
class VAPIDKey(db.Model):
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
public_key = db.Column(db.String(255), nullable=False)
|
|
private_key = db.Column(db.String(255), nullable=False)
|
|
subscriptions = db.relationship('Subscription', backref='vapid_key', lazy=True)
|
|
|
|
class Subscription(db.Model):
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
endpoint = db.Column(db.String(500), nullable=False)
|
|
p256dh = db.Column(db.String(255), nullable=False)
|
|
auth = db.Column(db.String(255), nullable=False)
|
|
vapid_key_id = db.Column(db.Integer, db.ForeignKey('vapid_key.id'), nullable=False)
|
|
|
|
|
|
|