add methods for messaging
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from typing import List
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey, Datetime
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime
|
||||
|
||||
from orm import Permission
|
||||
from orm.base import Base
|
||||
@@ -9,10 +10,11 @@ from orm.base import Base
|
||||
class Message(Base):
|
||||
__tablename__ = 'message'
|
||||
|
||||
sender: str = Column(ForeignKey("user.id"), nullable=False, comment="Sender")
|
||||
author: int = Column(ForeignKey("user.id"), nullable=False, comment="Sender")
|
||||
body: str = Column(String, nullable=False, comment="Body")
|
||||
createdAt: str = Column(Datetime, nullable=False, comment="Created at")
|
||||
updatedAt: str = Column(Datetime, nullable=True, comment="Updated at")
|
||||
replyTo: str = Column(ForeignKey("message.id", nullable=True, comment="Reply to"))
|
||||
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
|
||||
# TODO: work in progress, udpate this code
|
||||
|
Reference in New Issue
Block a user