Add new upload limit system (fix #4234).

This commit is contained in:
evazion
2020-01-23 18:14:30 -06:00
parent 3d6084338c
commit 18affeb4e9
9 changed files with 196 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env ruby
require_relative "../../config/environment"
uploaders = User.where(id: Post.select(:uploader_id)).bit_prefs_match(:can_upload_free, false)
warn "uploaders=#{uploaders.count}"
uploaders.find_each.with_index do |uploader, n|
uploader.new_upload_limit.update_limit!(nil, incremental: false)
warn "n=#{n} id=#{uploader.id} name=#{uploader.name} points=#{uploader.upload_points}"
end
contributors = User.bit_prefs_match(:can_upload_free, true)
contributors.update_all(upload_points: UploadLimit::MAXIMUM_POINTS)