added priority column to database.

This commit is contained in:
DJ2LS 2024-02-04 20:27:29 +01:00
parent 4b1b351711
commit 34e4578633

View file

@ -50,6 +50,7 @@ class P2PMessage(Base):
timestamp = Column(DateTime) timestamp = Column(DateTime)
status_id = Column(Integer, ForeignKey('status.id'), nullable=True) status_id = Column(Integer, ForeignKey('status.id'), nullable=True)
status = relationship('Status', backref='p2p_messages') status = relationship('Status', backref='p2p_messages')
priority = Column(Integer, default=10)
direction = Column(String) direction = Column(String)
statistics = Column(JSON, nullable=True) statistics = Column(JSON, nullable=True)
is_read = Column(Boolean, default=True) is_read = Column(Boolean, default=True)
@ -68,6 +69,7 @@ class P2PMessage(Base):
'body': self.body, 'body': self.body,
'attachments': [attachment.to_dict() for attachment in self.attachments], 'attachments': [attachment.to_dict() for attachment in self.attachments],
'status': self.status.name if self.status else None, 'status': self.status.name if self.status else None,
'priority': self.priority,
'is_read': self.is_read, 'is_read': self.is_read,
'statistics': self.statistics 'statistics': self.statistics
} }