From 73f26bd0a3c0e38fe9a5ec6fd3e93c39248d1f8c Mon Sep 17 00:00:00 2001 From: RockChinQ <45992437+RockChinQ@users.noreply.github.com> Date: Mon, 21 Sep 2026 11:19:03 +0000 Subject: [PATCH] test: include legacy pipeline dependency in identity migration fixtures --- tests/integration/persistence/test_rag_document_identity.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/integration/persistence/test_rag_document_identity.py b/tests/integration/persistence/test_rag_document_identity.py index ce209c63c..86c836614 100644 --- a/tests/integration/persistence/test_rag_document_identity.py +++ b/tests/integration/persistence/test_rag_document_identity.py @@ -13,6 +13,7 @@ from sqlalchemy.ext.asyncio import create_async_engine from langbot.pkg.api.http.context import ExecutionContext from langbot.pkg.entity.persistence.base import Base +from langbot.pkg.entity.persistence.pipeline import LegacyPipeline from langbot.pkg.entity.persistence.rag import File, KnowledgeBase from langbot.pkg.entity.persistence.user import User from langbot.pkg.entity.persistence.workspace import Workspace @@ -74,10 +75,12 @@ async def database(request, tmp_path): async def create_schema(engine, *, legacy=False): # Only the fixture-owned dependency closure; never all imported application tables. + # Full-head upgrades also create the manual migration journal, whose scoped + # foreign key requires the historical legacy_pipelines table. async with engine.begin() as conn: await conn.run_sync( lambda sync: Base.metadata.create_all( - sync, tables=[User.__table__, Workspace.__table__, KnowledgeBase.__table__] + sync, tables=[User.__table__, Workspace.__table__, LegacyPipeline.__table__, KnowledgeBase.__table__] ) ) if legacy: