v0.4 Go back to simpler use of MySQL2
This commit is contained in:
parent
d60cdafbfe
commit
8ab138242a
@ -47,7 +47,7 @@ class GossamerForumsDestroyDeletedPosts < ImportScripts::Base
|
|||||||
def destroy_deleted_posts_from_gossamer_with_user(username)
|
def destroy_deleted_posts_from_gossamer_with_user(username)
|
||||||
|
|
||||||
# Query the user ID from the legacy MySQL database
|
# Query the user ID from the legacy MySQL database
|
||||||
user_result = @mysql_client.query("SELECT user_id FROM gforums_User WHERE user_username = '#{username}' LIMIT 1")
|
user_result = @mysql_client.query("SELECT user_id FROM gforum_User WHERE user_username = '#{username}' LIMIT 1")
|
||||||
user_id_row = user_result.first
|
user_id_row = user_result.first
|
||||||
if user_id_row.nil?
|
if user_id_row.nil?
|
||||||
puts "DiscourseDeletedPosts: No user found with username: #{username}"
|
puts "DiscourseDeletedPosts: No user found with username: #{username}"
|
||||||
@ -56,7 +56,7 @@ class GossamerForumsDestroyDeletedPosts < ImportScripts::Base
|
|||||||
user_id = user_id_row['user_id']
|
user_id = user_id_row['user_id']
|
||||||
|
|
||||||
# Find all posts marked as deleted by the given user
|
# Find all posts marked as deleted by the given user
|
||||||
posts_result = @mysql_client.query("SELECT post_id FROM gforums_Post WHERE post_deleted = 1 AND user_id_fk = #{user_id}")
|
posts_result = @mysql_client.query("SELECT post_id FROM gforum_Post WHERE post_deleted = 1 AND user_id_fk = #{user_id}")
|
||||||
|
|
||||||
posts_result.each do |legacy_post|
|
posts_result.each do |legacy_post|
|
||||||
post_id = legacy_post['post_id']
|
post_id = legacy_post['post_id']
|
||||||
|
Loading…
Reference in New Issue
Block a user