Files
danbooru/script/fixes/018_fix_md5.rb
r888888888 7427833de6 fixes #1987
2013-09-18 17:59:46 -07:00

11 lines
367 B
Ruby

#!/usr/bin/env ruby
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
ActiveRecord::Base.connection.execute("set statement_timeout = 0")
Post.where("id in (?)", Pool.find(203).post_id_array).find_each do |post|
correct_md5 = Digest::MD5.file(post.file_path).hexdigest
post.update_attribute(:md5, correct_md5)
end