diff --git a/script/import_scripts/base.rb b/script/import_scripts/base.rb index 6334fbfeb..4895661f6 100644 --- a/script/import_scripts/base.rb +++ b/script/import_scripts/base.rb @@ -80,6 +80,7 @@ class ImportScripts::Base update_bumped_at update_last_posted_at + update_last_seen_at update_feature_topic_users update_category_featured_topics update_topic_count_replies @@ -508,6 +509,14 @@ class ImportScripts::Base User.exec_sql(sql) end + # scripts that are able to import last_seen_at from the source data should override this method + def update_last_seen_at + puts "", "updating last seen at on users" + + User.exec_sql("UPDATE users SET last_seen_at = created_at WHERE last_seen_at IS NULL") + User.exec_sql("UPDATE users SET last_seen_at = last_posted_at WHERE last_posted_at IS NOT NULL") + end + def update_feature_topic_users puts "", "updating featured topic users"