added lead field to shout, new table event (#71)

* added lead field to shout, new table event

* repurposed unused notifications table
This commit is contained in:
Igor Lobanov
2023-08-06 22:01:40 +02:00
committed by GitHub
parent 1fc6178b97
commit b4e14cce93
8 changed files with 13 additions and 40 deletions

View File

@@ -3,19 +3,10 @@ from datetime import datetime
from sqlalchemy import JSON as JSONType
from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, String
from sqlalchemy.orm import relationship
from base.orm import Base, local_session
from orm.rbac import Role
class UserNotifications(Base):
__tablename__ = "user_notifications"
# id auto
user = Column(Integer, ForeignKey("user.id"))
kind = Column(String, ForeignKey("notification.kind"))
values = Column(JSONType, nullable=True) # [ <var1>, .. ]
class UserRating(Base):
__tablename__ = "user_rating"
@@ -72,7 +63,6 @@ class User(Base):
deletedAt = Column(DateTime, nullable=True, comment="Deleted at")
links = Column(JSONType, nullable=True, comment="Links")
oauth = Column(String, nullable=True)
notifications = relationship(lambda: UserNotifications)
ratings = relationship(UserRating, foreign_keys=UserRating.user)
roles = relationship(lambda: Role, secondary=UserRole.__tablename__)
oid = Column(String, nullable=True)