fix(notification+vlog upload)
This commit is contained in:
@@ -27,3 +27,16 @@ class Notification(Base):
|
||||
|
||||
# Relationships
|
||||
user = relationship("User", back_populates="notifications")
|
||||
|
||||
class PushSubscription(Base):
|
||||
__tablename__ = "push_subscriptions"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
user_id = Column(Integer, ForeignKey("users.id"), nullable=False)
|
||||
endpoint = Column(String, unique=True, nullable=False)
|
||||
p256dh = Column(String, nullable=False)
|
||||
auth = Column(String, nullable=False)
|
||||
created_at = Column(DateTime, default=datetime.utcnow)
|
||||
|
||||
# Relationships
|
||||
user = relationship("User", back_populates="push_subscriptions")
|
||||
|
||||
@@ -27,6 +27,7 @@ class User(Base):
|
||||
mentions = relationship("PostMention", back_populates="mentioned_user", cascade="all, delete-orphan")
|
||||
vlogs = relationship("Vlog", back_populates="author", cascade="all, delete-orphan")
|
||||
notifications = relationship("Notification", back_populates="user", cascade="all, delete-orphan")
|
||||
push_subscriptions = relationship("PushSubscription", back_populates="user", cascade="all, delete-orphan")
|
||||
vlog_likes = relationship("VlogLike", back_populates="user", cascade="all, delete-orphan")
|
||||
vlog_comments = relationship("VlogComment", back_populates="user", cascade="all, delete-orphan")
|
||||
media_likes = relationship("MediaLike", back_populates="user", cascade="all, delete-orphan")
|
||||
|
||||
Reference in New Issue
Block a user