This commit is contained in:
2021-12-05 23:23:48 +03:00
parent cf020f8f3e
commit 7d75480217
4 changed files with 19 additions and 5 deletions

View File

@@ -10,7 +10,8 @@ from orm.base import Base
class Message(Base):
__tablename__ = 'message'
author: int = Column(ForeignKey("user.id"), nullable=False, comment="Sender")
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")