discourse/db
Ted Johansson 9655bf3e24
DEV: Delete upload references on draft cleanup (#26877)
In #22851 we added a dependent strategy for deleting upload references when a draft is destroyed. This, however, didn't catch all cases, because we still have some code that issues DELETE drafts queries directly to the database. Specifically in the weekly cleanup job handled by Draft#cleanup!.

This PR fixes that by turning the raw query into an ActiveRecord #destroy_all, which will invoke the dependent strategy that ultimately deletes the upload references. It also includes a post migration to clear orphaned upload references that are already in the database.
2024-05-06 14:08:10 +08:00
..
fixtures DEV: Use Discourse::SYSTEM_USER_ID in fixtures/009_users (#24743) 2023-12-07 09:04:45 +10:00
migrate FIX: Watched Words (+ Groups) with missing action (#26826) 2024-04-30 15:36:02 -04:00
post_migrate DEV: Delete upload references on draft cleanup (#26877) 2024-05-06 14:08:10 +08:00
api_test_seeds.rb