mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-09 20:39:29 +02:00
[1802] adjust the code to support a different db schemas (#1803)
This commit is contained in:
parent
be4b6189d2
commit
3fa9676478
@ -61,7 +61,7 @@ from shared_configs.enums import RerankerProvider
|
||||
|
||||
|
||||
class Base(DeclarativeBase):
|
||||
pass
|
||||
__abstract__ = True
|
||||
|
||||
|
||||
class EncryptedString(TypeDecorator):
|
||||
@ -448,7 +448,7 @@ class Document(Base):
|
||||
)
|
||||
tags = relationship(
|
||||
"Tag",
|
||||
secondary="document__tag",
|
||||
secondary=Document__Tag.__table__,
|
||||
back_populates="documents",
|
||||
)
|
||||
|
||||
@ -465,7 +465,7 @@ class Tag(Base):
|
||||
|
||||
documents = relationship(
|
||||
"Document",
|
||||
secondary="document__tag",
|
||||
secondary=Document__Tag.__table__,
|
||||
back_populates="tags",
|
||||
)
|
||||
|
||||
@ -814,7 +814,7 @@ class SearchDoc(Base):
|
||||
|
||||
chat_messages = relationship(
|
||||
"ChatMessage",
|
||||
secondary="chat_message__search_doc",
|
||||
secondary=ChatMessage__SearchDoc.__table__,
|
||||
back_populates="search_docs",
|
||||
)
|
||||
|
||||
@ -957,7 +957,7 @@ class ChatMessage(Base):
|
||||
)
|
||||
search_docs: Mapped[list["SearchDoc"]] = relationship(
|
||||
"SearchDoc",
|
||||
secondary="chat_message__search_doc",
|
||||
secondary=ChatMessage__SearchDoc.__table__,
|
||||
back_populates="chat_messages",
|
||||
)
|
||||
# NOTE: Should always be attached to the `assistant` message.
|
||||
|
Loading…
x
Reference in New Issue
Block a user