fix(ingest): flush Document before FK inserts; build fixes; shared-minio overlay
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user