mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-04 20:05:16 +02:00
feat(db): register DocumentFile and document.files relationship
This commit is contained in:
parent
0483af8023
commit
5e5f51b3a0
1 changed files with 6 additions and 0 deletions
|
|
@ -1478,6 +1478,11 @@ class Document(BaseModel, TimestampMixin):
|
||||||
chunks = relationship(
|
chunks = relationship(
|
||||||
"Chunk", back_populates="document", cascade="all, delete-orphan"
|
"Chunk", back_populates="document", cascade="all, delete-orphan"
|
||||||
)
|
)
|
||||||
|
# Original upload + future derived artifacts (redacted, filled-form).
|
||||||
|
# Model lives in app.file_storage.persistence to keep that feature cohesive.
|
||||||
|
files = relationship(
|
||||||
|
"DocumentFile", back_populates="document", cascade="all, delete-orphan"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class DocumentVersion(BaseModel, TimestampMixin):
|
class DocumentVersion(BaseModel, TimestampMixin):
|
||||||
|
|
@ -2931,6 +2936,7 @@ from app.automations.persistence import ( # noqa: E402, F401
|
||||||
AutomationRun,
|
AutomationRun,
|
||||||
AutomationTrigger,
|
AutomationTrigger,
|
||||||
)
|
)
|
||||||
|
from app.file_storage.persistence import DocumentFile # noqa: E402, F401
|
||||||
|
|
||||||
engine = create_async_engine(
|
engine = create_async_engine(
|
||||||
DATABASE_URL,
|
DATABASE_URL,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue