fix(ingest): flush Document before FK inserts; build fixes; shared-minio overlay
Some checks failed
CI / Backend (lint + tests + compose) (push) Has been cancelled
CI / Frontend (lint + type-check + build) (push) Has been cancelled

This commit is contained in:
Vadim Malanov
2026-07-08 22:33:01 +03:00
parent 140e1d4534
commit 6fbc778c1f
5 changed files with 45 additions and 0 deletions

View File

@@ -139,6 +139,13 @@ class SqlAlchemyKnowledgeIngestRepository:
if existing_doc.status == DocumentStatus.DISCOVERED:
existing_doc.status = DocumentStatus.STORED_ORIGINAL
# Flush the Document row before FK-dependent inserts: there is no
# ORM relationship between AssetIngestJob/DocumentArtifact and
# Document, so the unit of work does not order these INSERTs and
# PostgreSQL rejects the job row with a ForeignKeyViolation
# (SQLite-based tests do not enforce FKs, hence unseen there).
db.flush()
ensure_artifact(
db,
document_id=document_id,