Skip to content

Delete orphaned attachments#7513

Open
labkey-adam wants to merge 8 commits intodevelopfrom
fb_delete_orphans
Open

Delete orphaned attachments#7513
labkey-adam wants to merge 8 commits intodevelopfrom
fb_delete_orphans

Conversation

@labkey-adam
Copy link
Contributor

@labkey-adam labkey-adam commented Mar 22, 2026

Rationale

Deployments have orphaned attachments. For now, we'll give admins the ability to review and delete them, if they wish. In the future, once we've confirmed our orphan detection is correct, we'll likely add an update script that invokes this.

Tasks 📍

  • Dev
  • Code review @labkey-matthewb
  • Manual Testing / Verify Fix @DariaBod
    • Admin Console -> Attachments -> Click on any count to see details -> Customize Grid -> Show Hidden Fields -> Add "Orphaned" field -> Clear the ParentType filter -> Filter by Orphaned = True: you now have a list of all orphaned attachments in your server
    • If you don't have any orphaned attachments you can create some (on develop, as long as we haven't merged my fixes from 26.3) by:
    • Invoke the core.deleteOrphanedAttachments() upgrade code: Admin Console -> SQL Scripts -> Upgrade Code -> Select "Core: deleteOrphanedAttachments()" -> Invoke
    • Upgrade code should execute without errors and your orphaned attachment grid should now be empty
  • Needs Automation

@labkey-adam labkey-adam self-assigned this Mar 22, 2026
@labkey-adam labkey-adam added this to the 26.04 milestone Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants