v0.59 Final topic-post import run -- add logic for appending counts since we are adding to a live Discourse host now
This commit is contained in:
parent
958e37771e
commit
7bd8f0068a
BIN
.nfs0000000000163a0500000006
Normal file
BIN
.nfs0000000000163a0500000006
Normal file
Binary file not shown.
@ -1564,7 +1564,7 @@ class GossamerForumsImporter < ImportScripts::Base
|
|||||||
puts "OVERRIDE Highest processed post_id: #{highest_processed_post_id}"
|
puts "OVERRIDE Highest processed post_id: #{highest_processed_post_id}"
|
||||||
|
|
||||||
# Execute the query to get all posts ordered by post_id
|
# Execute the query to get all posts ordered by post_id
|
||||||
execute_query("SELECT post_id, user_id_fk, forum_id_fk, post_root_id, post_subject, post_time, post_message, post_father_id, post_likes, post_replies FROM gforum_Post WHERE post_id > #{highest_processed_post_id} ORDER BY post_id").each do |row|
|
execute_query("SELECT post_id, user_id_fk, forum_id_fk, post_root_id, post_subject, post_time, post_message, post_father_id, post_replies FROM gforum_Post WHERE post_id > #{highest_processed_post_id} ORDER BY post_id").each do |row|
|
||||||
post_id = row['post_id'].to_i
|
post_id = row['post_id'].to_i
|
||||||
|
|
||||||
# Skip posts that have already been processed
|
# Skip posts that have already been processed
|
||||||
@ -1673,15 +1673,15 @@ class GossamerForumsImporter < ImportScripts::Base
|
|||||||
post = Post.create!(
|
post = Post.create!(
|
||||||
topic_id: current_topic_id,
|
topic_id: current_topic_id,
|
||||||
user_id: discourse_user_id,
|
user_id: discourse_user_id,
|
||||||
# raw: import_attachments(row['post_message'], row['post_id']),
|
|
||||||
# raw: row['post_message'] || "",
|
|
||||||
raw: sanitized_post_message,
|
raw: sanitized_post_message,
|
||||||
created_at: Time.at(row['post_time']),
|
created_at: Time.at(row['post_time']),
|
||||||
updated_at: Time.at(row['post_time']),
|
updated_at: Time.at(row['post_time']),
|
||||||
like_count: row['post_likes'] || 0,
|
|
||||||
reads: post_views || 0,
|
reads: post_views || 0,
|
||||||
post_number: post_number
|
post_number: post_number
|
||||||
)
|
)
|
||||||
|
# like_count: row['post_likes'] || 0,
|
||||||
|
# raw: import_attachments(row['post_message'], row['post_id']),
|
||||||
|
# raw: row['post_message'] || "",
|
||||||
# post_number: topic_post_numbers[topic.id]
|
# post_number: topic_post_numbers[topic.id]
|
||||||
post.custom_fields['original_gossamer_id'] = row['post_id']
|
post.custom_fields['original_gossamer_id'] = row['post_id']
|
||||||
post.save!
|
post.save!
|
||||||
|
Loading…
Reference in New Issue
Block a user