v0.28.1 Debug output addition
This commit is contained in:
		@@ -1,5 +1,5 @@
 | 
				
			|||||||
# gossamer threads migration-import code
 | 
					# gossamer threads migration-import code
 | 
				
			||||||
# v0.28
 | 
					# v0.28.1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
require 'mysql2'
 | 
					require 'mysql2'
 | 
				
			||||||
require 'open-uri'
 | 
					require 'open-uri'
 | 
				
			||||||
@@ -1142,6 +1142,7 @@ class GossamerForumsImporter < ImportScripts::Base
 | 
				
			|||||||
      user_id, count = row
 | 
					      user_id, count = row
 | 
				
			||||||
#      user = User.find(user_id)
 | 
					#      user = User.find(user_id)
 | 
				
			||||||
#      user.update!(topic_count: count)
 | 
					#      user.update!(topic_count: count)
 | 
				
			||||||
 | 
					      puts "update_user_stats  user_id  #{user_id}  topic_count  #{count}"
 | 
				
			||||||
      user_stat = UserStat.find_or_initialize_by(user_id: user_id)
 | 
					      user_stat = UserStat.find_or_initialize_by(user_id: user_id)
 | 
				
			||||||
      user_stat.update_columns(topic_count: count)
 | 
					      user_stat.update_columns(topic_count: count)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
@@ -1150,6 +1151,7 @@ class GossamerForumsImporter < ImportScripts::Base
 | 
				
			|||||||
      user_id, count = row
 | 
					      user_id, count = row
 | 
				
			||||||
#      user = User.find(user_id)
 | 
					#      user = User.find(user_id)
 | 
				
			||||||
#      user.update!(post_count: count)
 | 
					#      user.update!(post_count: count)
 | 
				
			||||||
 | 
					      puts "update_user_stats  user_id  #{user_id}  post_count  #{count}"
 | 
				
			||||||
      user_stat = UserStat.find_or_initialize_by(user_id: user_id)
 | 
					      user_stat = UserStat.find_or_initialize_by(user_id: user_id)
 | 
				
			||||||
      user_stat.update_columns(post_count: count)
 | 
					      user_stat.update_columns(post_count: count)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
@@ -1166,9 +1168,11 @@ class GossamerForumsImporter < ImportScripts::Base
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# OVERRIDE - to get to problem msg
 | 
					# OVERRIDE - to get to problem msg
 | 
				
			||||||
    highest_processed_personal_id = 350
 | 
					    highest_processed_personal_id = 350
 | 
				
			||||||
 | 
					    puts "Highest processed personal_id override: #{highest_processed_personal_id}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    execute_query("SELECT * FROM gforum_Message").each do |row|
 | 
					    execute_query("SELECT * FROM gforum_Message").each do |row|
 | 
				
			||||||
      msg_id = row['msg_id'].to_i
 | 
					      msg_id = row['msg_id'].to_i
 | 
				
			||||||
 | 
					      puts "msg_id  #{msg_id}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      # Skip posts that have already been processed
 | 
					      # Skip posts that have already been processed
 | 
				
			||||||
      next if msg_id <= highest_processed_personal_id
 | 
					      next if msg_id <= highest_processed_personal_id
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user