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:
11
script/fixes/base.rb
Executable file
11
script/fixes/base.rb
Executable 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
|
||||
Reference in New Issue
Block a user