uploads: delete old upload records from before the rework.
Delete all old upload records from before the upload rework inabdab7a0a/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:
8
script/fixes/099_delete_old_uploads.rb
Executable file
8
script/fixes/099_delete_old_uploads.rb
Executable 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
|
||||
Reference in New Issue
Block a user