# Uploads not getting orphaned and purged

**URL:** <https://meta.discourse.org/t/uploads-not-getting-orphaned-and-purged/259036>\
**Category:** Product Support\
**Created:** [March 22, 2023, 1:47pm UTC](https://meta.discourse.org/t/uploads-not-getting-orphaned-and-purged/259036 "2023-03-22T13:47:52Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![groove6j](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/groove6j/32/367325_2.png) [@groove6j](https://meta.discourse.org/u/groove6j)\
**Post date:** [March 27, 2024, 8:54am UTC](https://meta.discourse.org/t/uploads-not-getting-orphaned-and-purged/259036/9 "2024-03-27T08:54:48Z")

</div>

I installed the forum 2 weeks ago and it has this problem since beginning. Looks like some bug.  
Can you run the same SQL query and check if there are lots of stuck “Drafts” references? Its easy to see, I have dozens of them but in drafts table there are 2, maybe 3 real drafts. Looks like they don’t get deleted after editing (not being a draft anymore, but reference left in the database every time a post is edited for example).

I need to figure out how to delete a reference entry from the database and delete the refs for one file at first, then check if the cleanup task works.  
I dont know how safe this is to do, but these coutless Drafts entries seem just wrong to me.

I can provide logs to staff/devs, I’m just new to Discourse and I dont know which logs files would help.

**EDIT** :  
I’m trying to understand the database structure, and can I delete those upload entries without further problems (I dont want to miss some important DB relations). Also I don’t understand what exactly draft\_sequences are.  
But I have to dublicate my production forum to a local VM, only then I can test…

---

_[View the full topic](https://meta.discourse.org/t/uploads-not-getting-orphaned-and-purged/259036)._
