remove message table
This commit is contained in:
parent
34b48cbc90
commit
77759f620d
|
@ -1,7 +1,6 @@
|
|||
from orm.rbac import Operation, Resource, Permission, Role, RoleStorage
|
||||
from orm.community import Community
|
||||
from orm.user import User, UserRating, UserRole, UserStorage
|
||||
from orm.message import Message
|
||||
from orm.topic import Topic, TopicSubscription, TopicStorage
|
||||
from orm.notification import Notification
|
||||
from orm.shout import Shout, ShoutAuthor, ShoutTopic, ShoutRating, ShoutViewByDay,\
|
||||
|
@ -9,7 +8,7 @@ from orm.shout import Shout, ShoutAuthor, ShoutTopic, ShoutRating, ShoutViewByDa
|
|||
from orm.base import Base, engine, local_session
|
||||
from orm.comment import Comment, CommentRating
|
||||
|
||||
__all__ = ["User", "Role", "Community", "Operation", "Permission", "Message", "Shout", "Topic", "TopicSubscription", "Notification", "ShoutRating", "Comment", "CommentRating", "UserRating"]
|
||||
__all__ = ["User", "Role", "Community", "Operation", "Permission", "Shout", "Topic", "TopicSubscription", "Notification", "ShoutRating", "Comment", "CommentRating", "UserRating"]
|
||||
|
||||
Base.metadata.create_all(engine)
|
||||
Operation.init_table()
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
from typing import List
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime
|
||||
|
||||
from orm import Permission
|
||||
from orm.base import Base
|
||||
|
||||
|
||||
class Message(Base):
|
||||
__tablename__ = 'message'
|
||||
|
||||
fromUser: int = Column(ForeignKey("user.id"), nullable=False, comment="Sender")
|
||||
chatRoom: int = Column(Integer, nullable=False, comment="Chatroom")
|
||||
body: str = Column(String, nullable=False, comment="Body")
|
||||
createdAt = Column(DateTime, nullable=False, default = datetime.now, comment="Created at")
|
||||
updatedAt = Column(DateTime, nullable=True, comment="Updated at")
|
||||
replyTo: int = Column(ForeignKey("message.id"), nullable=True, comment="Reply to")
|
||||
|
||||
|
||||
# TODO: work in progress, udpate this code
|
|
@ -1,4 +1,4 @@
|
|||
from orm import Message, User
|
||||
from orm import User
|
||||
from orm.base import local_session
|
||||
|
||||
from resolvers.base import mutation, query, subscription
|
||||
|
|
Loading…
Reference in New Issue
Block a user