From 365d33998595963f4d05c9ade33ee5328b2bd5aa Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Tue, 15 Jun 2021 19:08:55 +0530 Subject: [PATCH] DEV: fix Flarum import script (#13385) --- script/import_scripts/flarum_import.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/script/import_scripts/flarum_import.rb b/script/import_scripts/flarum_import.rb index bd96ad1eec8..ea4eb3dddfe 100644 --- a/script/import_scripts/flarum_import.rb +++ b/script/import_scripts/flarum_import.rb @@ -39,7 +39,7 @@ class ImportScripts::FLARUM < ImportScripts::Base batches(BATCH_SIZE) do |offset| results = mysql_query( - "SELECT id, username, email, join_time created_at,last_seen_time last_visit_time, password + "SELECT id, username, email, joined_at, last_seen_at FROM users LIMIT #{BATCH_SIZE} OFFSET #{offset};") @@ -53,9 +53,9 @@ class ImportScripts::FLARUM < ImportScripts::Base email: user['email'], username: user['username'], name: user['username'], - created_at: user['created_at'], - last_seen_at: user['last_visit_time'], - password: user['password'] } + created_at: user['joined_at'], + last_seen_at: user['last_seen_at'] + } end end end @@ -106,13 +106,13 @@ class ImportScripts::FLARUM < ImportScripts::Base d.first_post_id first_post_id, p.user_id user_id, p.content raw, - p.created_at created_at - t.tag_id category_id, + p.created_at created_at, + t.tag_id category_id FROM posts p, discussions d, - discussion_tag t, - + discussion_tag t WHERE p.discussion_id = d.id + AND t.discussion_id = d.id ORDER BY p.created_at LIMIT #{BATCH_SIZE} OFFSET #{offset};