From 5b6f2c3c0ef7923184e388a6565a0699237189bf Mon Sep 17 00:00:00 2001 From: saint Date: Sat, 17 Aug 2024 01:57:32 +1000 Subject: [PATCH] v0.39.2 Add SQLite table for tracking successful post importation; Split out user import into three separate callable methods; require sys/proctable --- gossamer_forums.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gossamer_forums.rb b/gossamer_forums.rb index a8b037a..7c35bb4 100644 --- a/gossamer_forums.rb +++ b/gossamer_forums.rb @@ -1,7 +1,7 @@ # Federated Computer, Inc. # David Sainty 2024 A.D. # Gossamer Threads to Discourse -- Migration-Import Script -# v0.39.1 Add SQLite table for tracking successful post importation; Split out user import into three separate callable methods; require sys/proctable +# v0.39.2 Add SQLite table for tracking successful post importation; Split out user import into three separate callable methods; require sys/proctable require 'mysql2' require 'open-uri' @@ -152,7 +152,7 @@ class GossamerForumsImporter < ImportScripts::Base end def insert_username_mapping(old_username, new_username, email, real_name) - @db.execute "INSERT INTO username_map (old_username, new_username, email, real_name) VALUES (?, ?, ?, ?)", old_username, new_username, email, real_name + @db.execute "INSERT OR REPLACE INTO username_map (old_username, new_username, email, real_name) VALUES (?, ?, ?, ?)", old_username, new_username, email, real_name end # Define a method to export the username mapping table to a CSV file