fix: Fix cascade deletion (#1641)

This commit is contained in:
Matthew Zhou
2025-04-09 10:55:32 -07:00
committed by GitHub
parent 961a28f72c
commit bb0ea1844f
2 changed files with 4 additions and 4 deletions

View File

@@ -51,8 +51,10 @@ class Organization(SqlalchemyBase):
providers: Mapped[List["Provider"]] = relationship("Provider", back_populates="organization", cascade="all, delete-orphan")
identities: Mapped[List["Identity"]] = relationship("Identity", back_populates="organization", cascade="all, delete-orphan")
groups: Mapped[List["Group"]] = relationship("Group", back_populates="organization", cascade="all, delete-orphan")
llm_batch_jobs: Mapped[List["Agent"]] = relationship("LLMBatchJob", back_populates="organization", cascade="all, delete-orphan")
llm_batch_items: Mapped[List["Agent"]] = relationship("LLMBatchItem", back_populates="organization", cascade="all, delete-orphan")
llm_batch_jobs: Mapped[List["LLMBatchJob"]] = relationship("LLMBatchJob", back_populates="organization", cascade="all, delete-orphan")
llm_batch_items: Mapped[List["LLMBatchItem"]] = relationship(
"LLMBatchItem", back_populates="organization", cascade="all, delete-orphan"
)
@property
def passages(self) -> List[Union["SourcePassage", "AgentPassage"]]:

View File

@@ -9,14 +9,12 @@ import pytest
from letta import create_client
from letta.agent import Agent
from letta.client.client import LocalClient
from letta.errors import ContextWindowExceededError
from letta.llm_api.helpers import calculate_summarizer_cutoff
from letta.schemas.embedding_config import EmbeddingConfig
from letta.schemas.enums import MessageRole
from letta.schemas.letta_message_content import TextContent
from letta.schemas.llm_config import LLMConfig
from letta.schemas.message import Message
from letta.settings import summarizer_settings
from letta.streaming_interface import StreamingRefreshCLIInterface
from tests.helpers.endpoints_helper import EMBEDDING_CONFIG_PATH
from tests.helpers.utils import cleanup