add debug output for fix script
This commit is contained in:
@@ -7,13 +7,17 @@ ActiveRecord::Base.connection.execute("set statement_timeout = 0")
|
|||||||
Pool.find_each do |pool|
|
Pool.find_each do |pool|
|
||||||
if pool.versions.count == 0
|
if pool.versions.count == 0
|
||||||
pool.create_version(true)
|
pool.create_version(true)
|
||||||
|
puts "create pool version for #{pool.id}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ForumTopic.find_each do |topic|
|
ForumTopic.find_each do |topic|
|
||||||
last = topic.posts.last
|
last = topic.posts.last
|
||||||
topic.update_column(:updater_id, last.creator_id) if topic.updater_id != last.creator_id
|
if topic.updater_id != last.creator_id || topic.updated_at != last.updated_at
|
||||||
topic.update_column(:updated_at, last.updated_at) if topic.updated_at != last.updated_at
|
topic.update_column(:updater_id, last.creator_id) if topic.updater_id != last.creator_id
|
||||||
|
topic.update_column(:updated_at, last.updated_at) if topic.updated_at != last.updated_at
|
||||||
|
puts "update topic for #{topic.id}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
admin = User.admins.first
|
admin = User.admins.first
|
||||||
@@ -22,6 +26,7 @@ CurrentUser.scoped(admin, "127.0.0.1") do
|
|||||||
Post.where("created_at >= ?", "2013-02-01").find_each do |post|
|
Post.where("created_at >= ?", "2013-02-01").find_each do |post|
|
||||||
if post.tag_string != post.versions.last.tag_string
|
if post.tag_string != post.versions.last.tag_string
|
||||||
post.create_version(true)
|
post.create_version(true)
|
||||||
|
puts "create post version for #{post.id}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user