add community subscription; unify subscription interface
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from orm.rbac import Operation, Resource, Permission, Role, RoleStorage
|
||||
from orm.community import Community
|
||||
from orm.community import Community, CommunitySubscription
|
||||
from orm.user import User, UserRating, UserRole, UserStorage
|
||||
from orm.topic import Topic, TopicSubscription, TopicStorage
|
||||
from orm.notification import Notification
|
||||
|
@@ -3,6 +3,14 @@ from sqlalchemy import Column, Integer, String, ForeignKey, DateTime
|
||||
from sqlalchemy.orm import relationship, backref
|
||||
from orm.base import Base, local_session
|
||||
|
||||
class CommunitySubscription(Base):
|
||||
__tablename__ = 'community_subscription'
|
||||
|
||||
id = None
|
||||
subscriber = Column(ForeignKey('user.slug'), primary_key = True)
|
||||
community = Column(ForeignKey('community.slug'), primary_key = True)
|
||||
createdAt: str = Column(DateTime, nullable=False, default = datetime.now, comment="Created at")
|
||||
|
||||
|
||||
class Community(Base):
|
||||
__tablename__ = 'community'
|
||||
|
Reference in New Issue
Block a user