v0.39.2 Add SQLite table for tracking successful post importation; Split out user import into three separate callable methods; require sys/proctable

This commit is contained in:
David Sainty 2024-08-17 01:57:32 +10:00
parent ea1dae98d7
commit 5b6f2c3c0e

View File

@ -1,7 +1,7 @@
# Federated Computer, Inc. # Federated Computer, Inc.
# David Sainty <saint@federated.computer> 2024 A.D. # David Sainty <saint@federated.computer> 2024 A.D.
# Gossamer Threads to Discourse -- Migration-Import Script # 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 'mysql2'
require 'open-uri' require 'open-uri'
@ -152,7 +152,7 @@ class GossamerForumsImporter < ImportScripts::Base
end end
def insert_username_mapping(old_username, new_username, email, real_name) 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 end
# Define a method to export the username mapping table to a CSV file # Define a method to export the username mapping table to a CSV file