users: fix incorrect count columns on users table.

Fix incorrect post_upload_count, note_update_count, and
unread_dmail_count columns on the users table.
This commit is contained in:
evazion
2022-01-09 12:06:16 -06:00
parent 5623b139aa
commit c09cd9e9fd
4 changed files with 120 additions and 20 deletions

11
script/fixes/base.rb Executable file
View File

@@ -0,0 +1,11 @@
require_relative "../../config/environment"
# Run a block of code in a transaction, and only commit it after confirmation.
def with_confirmation(&block)
ApplicationRecord.transaction do
yield
print "Commit? (yes/no): "
raise "abort" unless STDIN.readline.chomp == "yes"
end
end