mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-06 22:12:12 +02:00
refactor(db): rename search_space to workspace in satellite ORM models (Phase 2 Wave B)
Flip search_space_id -> workspace_id and the workspace relationship/back_populates
in the automations, file_storage, notifications, and podcasts persistence models,
and drop the Phase 1 Column("workspace_id", ...) shim. Full SQLAlchemy mapper
configuration now passes (db.py + satellites consistent).
This commit is contained in:
parent
df03565940
commit
d948b769ba
4 changed files with 7 additions and 11 deletions
|
|
@ -24,8 +24,7 @@ from ..enums.automation_status import AutomationStatus
|
|||
class Automation(BaseModel, TimestampMixin):
|
||||
__tablename__ = "automations"
|
||||
|
||||
search_space_id = Column(
|
||||
"workspace_id",
|
||||
workspace_id = Column(
|
||||
Integer,
|
||||
ForeignKey("workspaces.id", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
|
|
@ -66,7 +65,7 @@ class Automation(BaseModel, TimestampMixin):
|
|||
index=True,
|
||||
)
|
||||
|
||||
search_space = relationship("SearchSpace", back_populates="automations")
|
||||
workspace = relationship("Workspace", back_populates="automations")
|
||||
created_by = relationship("User", back_populates="automations")
|
||||
triggers = relationship(
|
||||
"AutomationTrigger",
|
||||
|
|
|
|||
|
|
@ -29,8 +29,7 @@ class DocumentFile(BaseModel, TimestampMixin):
|
|||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
search_space_id = Column(
|
||||
"workspace_id",
|
||||
workspace_id = Column(
|
||||
Integer,
|
||||
ForeignKey("workspaces.id", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
|
|
|
|||
|
|
@ -47,8 +47,7 @@ class Notification(BaseModel, TimestampMixin):
|
|||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
search_space_id = Column(
|
||||
"workspace_id",
|
||||
workspace_id = Column(
|
||||
Integer,
|
||||
ForeignKey("workspaces.id", ondelete="CASCADE"),
|
||||
nullable=True,
|
||||
|
|
@ -70,4 +69,4 @@ class Notification(BaseModel, TimestampMixin):
|
|||
)
|
||||
|
||||
user = relationship("User", back_populates="notifications")
|
||||
search_space = relationship("SearchSpace", back_populates="notifications")
|
||||
workspace = relationship("Workspace", back_populates="notifications")
|
||||
|
|
|
|||
|
|
@ -68,13 +68,12 @@ class Podcast(BaseModel, TimestampMixin):
|
|||
# Legacy local audio path; retained for back-compat until cutover.
|
||||
file_location = Column(Text, nullable=True)
|
||||
|
||||
search_space_id = Column(
|
||||
"workspace_id",
|
||||
workspace_id = Column(
|
||||
Integer,
|
||||
ForeignKey("workspaces.id", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
)
|
||||
search_space = relationship("SearchSpace", back_populates="podcasts")
|
||||
workspace = relationship("Workspace", back_populates="podcasts")
|
||||
|
||||
thread_id = Column(
|
||||
Integer,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue