mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
60bf47ede0
The attachment cleanup loop used findAllInBatches, which advances an OFFSET each iteration. Because the callback deletes each batch, the remaining rows shift backwards and the advancing offset skips over them, leaving attachments that still reference the team. team.destroy() then failed with attachments_teamId_fkey. Page from offset 0 until no attachments remain, and remove the now redundant per-user attachment delete so the loop is the single authoritative cleanup. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>