diff --git a/backend/internal/storage/postgres/attachments.go b/backend/internal/storage/postgres/attachments.go index 8caf791..d0e9b62 100644 --- a/backend/internal/storage/postgres/attachments.go +++ b/backend/internal/storage/postgres/attachments.go @@ -72,7 +72,7 @@ func (r *AttachmentRepo) GetByID(ctx context.Context, id string) (*domain.Attach const q = ` SELECT id, chat_id, owner_id, filename, content_type, size_bytes, sha256, object_key, status, error_code, created_at, updated_at, - attempts, next_attempt_at, locked_until, pipeline_version, staging_key + attempts, next_attempt_at, locked_until, pipeline_version, COALESCE(staging_key, '') FROM attachments WHERE id = $1::uuid ` @@ -280,7 +280,7 @@ func (r *AttachmentRepo) ListExpiredLeases(ctx context.Context, limit int) ([]do const q = ` SELECT id, chat_id, owner_id, filename, content_type, size_bytes, sha256, object_key, status, error_code, created_at, updated_at, - attempts, next_attempt_at, locked_until, pipeline_version, staging_key + attempts, next_attempt_at, locked_until, pipeline_version, COALESCE(staging_key, '') FROM attachments WHERE status = 'processing' AND locked_until < now() ORDER BY locked_until