feat: replace the end user column in the web page Log & Ann. with the… (#653)

Co-authored-by: Hao Fu <hao.fu@helloklarity.com>
This commit is contained in:
TheFu527
2023-07-27 12:48:43 +08:00
committed by GitHub
parent f9412f5fdb
commit 94b54b7ca9
4 changed files with 11 additions and 2 deletions

View File

@@ -203,7 +203,7 @@ class Conversation(db.Model):
system_instruction_tokens = db.Column(db.Integer, nullable=False, server_default=db.text('0'))
status = db.Column(db.String(255), nullable=False)
from_source = db.Column(db.String(255), nullable=False)
from_end_user_id = db.Column(UUID)
from_end_user_id = db.Column(UUID, db.ForeignKey('end_users.id'))
from_account_id = db.Column(UUID)
read_at = db.Column(db.DateTime)
read_account_id = db.Column(UUID)
@@ -213,6 +213,8 @@ class Conversation(db.Model):
messages = db.relationship("Message", backref="conversation", lazy='select', passive_deletes="all")
message_annotations = db.relationship("MessageAnnotation", backref="conversation", lazy='select', passive_deletes="all")
end_user = db.relationship("EndUser", backref="conversations")
is_deleted = db.Column(db.Boolean, nullable=False, server_default=db.text('false'))
@property