uploads: delete old upload records from before the rework.

Delete all old upload records from before the upload rework in abdab7a0a
/ f11c46b4f. Uploads from before the rework don't have any attached
media assets, so they're not valid under the new system because we can't
find which files they were for.

Before the rework, completed uploads were only saved for 1 hour, and
failed uploads were only saved for 3 days, so deleting this data
doesn't really lose anything that wouldn't have been deleted before.
This commit is contained in:
evazion
2022-02-07 14:44:23 -06:00
parent 572878fb0d
commit 19a9cf3d2f

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env ruby
require_relative "base"
with_confirmation do
# Delete all old upload records from before the upload rework in abdab7a0a / f11c46b4f.
Upload.where("uploads.id <= 4974361").where.missing(:upload_media_assets).delete_all
end