refactored-shout-comments

This commit is contained in:
2022-06-21 15:21:02 +03:00
parent 11f81d46ce
commit ace22f5e8b
15 changed files with 96 additions and 96 deletions

View File

@@ -4,7 +4,7 @@ from orm.user import User, UserRating, UserRole, UserStorage
from orm.topic import Topic, TopicSubscription, TopicStorage
from orm.notification import Notification
from orm.shout import Shout, ShoutAuthor, ShoutTopic, ShoutRating, ShoutViewByDay,\
ShoutRatingStorage, ShoutViewStorage
ShoutRatingStorage, ShoutViewStorage, ShoutCommentsSubscription
from orm.base import Base, engine, local_session
from orm.comment import Comment, CommentRating #, CommentRatingStorage
from orm.proposal import Proposal, ProposalRating #, ProposalRatingStorage

View File

@@ -7,7 +7,7 @@ from orm.base import Base
class ProposalRating(Base):
__tablename__ = "comment_rating"
__tablename__ = "proposal_rating"
id = None
proposal_id = Column(ForeignKey('proposal.id'), primary_key = True)

View File

@@ -11,6 +11,14 @@ from functools import reduce
import asyncio
class ShoutCommentsSubscription(Base):
__tablename__ = "shout_comments_subscription"
id = None
subscriber = Column(ForeignKey('user.slug'), primary_key = True)
shout = Column(ForeignKey('shout.slug'), primary_key = True)
createdAt: str = Column(DateTime, nullable=False, default = datetime.now, comment="Created at")
class ShoutAuthor(Base):
__tablename__ = "shout_author"