mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 19:14:11 +08:00

We currently are accumulating orphaned upload references whenever drafts are deleted. This change deals with future cases by adding a dependent strategy of delete_all on the Draft#upload_references association. (We don't really need destroy strategy here, since UploadReference is a simple data bag and there are no validations or callbacks on the model.) It deals with existing cases through a migration that deletes all existing, orphaned draft upload references.