mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FEATURE: import scripts update last_seen_at on users based on created date and last post date
This commit is contained in:
@ -80,6 +80,7 @@ class ImportScripts::Base
|
|||||||
|
|
||||||
update_bumped_at
|
update_bumped_at
|
||||||
update_last_posted_at
|
update_last_posted_at
|
||||||
|
update_last_seen_at
|
||||||
update_feature_topic_users
|
update_feature_topic_users
|
||||||
update_category_featured_topics
|
update_category_featured_topics
|
||||||
update_topic_count_replies
|
update_topic_count_replies
|
||||||
@ -508,6 +509,14 @@ class ImportScripts::Base
|
|||||||
User.exec_sql(sql)
|
User.exec_sql(sql)
|
||||||
end
|
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
|
def update_feature_topic_users
|
||||||
puts "", "updating featured topic users"
|
puts "", "updating featured topic users"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user