From 7bd8f0068a7ba935947af2db11829bf79bc0bd50 Mon Sep 17 00:00:00 2001 From: saint Date: Mon, 2 Sep 2024 15:26:40 +1000 Subject: [PATCH] v0.59 Final topic-post import run -- add logic for appending counts since we are adding to a live Discourse host now --- .nfs0000000000163a0500000006 | Bin 0 -> 4096 bytes gossamer_forums.rb | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 .nfs0000000000163a0500000006 diff --git a/.nfs0000000000163a0500000006 b/.nfs0000000000163a0500000006 new file mode 100644 index 0000000000000000000000000000000000000000..0501b921bdcb06c038b63dcc99b07545769735c5 GIT binary patch literal 4096 zcmeIuJqp4=5QgC`1rbESI%=J4VjA@Z7M8IM`Pt|~)(JZs?7fO-@-kMM)PeN!O*y>7 zz>|lU)7d)&k@(GAh)?{kCdZX{J*R>*eRth{WcrTGNF{_URb7*jH!@20NAe*{%>}iV zm9I@h)}>rn-8hz4V$O`RX+^d*9N2vH0Rjj>U|67amA{`Q@h%FxV7pm+%SAHWVhaHX SKmY;|fB*y_009X6rN9@+ohV@d literal 0 HcmV?d00001 diff --git a/gossamer_forums.rb b/gossamer_forums.rb index 3a93e69..9d6df1d 100644 --- a/gossamer_forums.rb +++ b/gossamer_forums.rb @@ -1564,7 +1564,7 @@ class GossamerForumsImporter < ImportScripts::Base puts "OVERRIDE Highest processed post_id: #{highest_processed_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 # Skip posts that have already been processed @@ -1673,15 +1673,15 @@ class GossamerForumsImporter < ImportScripts::Base post = Post.create!( topic_id: current_topic_id, user_id: discourse_user_id, -# raw: import_attachments(row['post_message'], row['post_id']), -# raw: row['post_message'] || "", raw: sanitized_post_message, created_at: Time.at(row['post_time']), updated_at: Time.at(row['post_time']), - like_count: row['post_likes'] || 0, reads: post_views || 0, 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.custom_fields['original_gossamer_id'] = row['post_id'] post.save!