model upgrade

This commit is contained in:
2021-08-20 11:08:32 +03:00
parent 94518adcc5
commit ee3b186ba1
8 changed files with 85 additions and 38 deletions

View File

@@ -6,12 +6,4 @@ class Notification(Base):
kind: str = Column(String, unique = True, primary_key = True)
template: str = Column(String, nullable = False)
variables: JSONType = Column(JSONType, nullable = True) # [ <var1>, .. ]
class UserNotification(Base):
__tablename__ = 'user_notification'
id: int = Column(Integer, primary_key = True)
user_id: int = Column(Integer, ForeignKey("user.id"))
kind: str = Column(String, ForeignKey("notification.kind"))
values: JSONType = Column(JSONType, nullable = True) # [ <var1>, .. ]
variables: JSONType = Column(JSONType, nullable = True) # [ <var1>, .. ]