From 6e603c85a855729116df25f134d7fa124937fcee Mon Sep 17 00:00:00 2001 From: Jay Pfaffman Date: Mon, 26 Sep 2016 12:18:11 -0700 Subject: [PATCH] mbox: sort input files by title, sort messages by date --- script/import_scripts/mbox.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/script/import_scripts/mbox.rb b/script/import_scripts/mbox.rb index fecfcc8fa68..ee66e5b0ac4 100755 --- a/script/import_scripts/mbox.rb +++ b/script/import_scripts/mbox.rb @@ -63,6 +63,8 @@ class ImportScripts::Mbox < ImportScripts::Base files.flatten! + files.sort! + files.each_with_index do |f, idx| if SPLIT_AT.present? msg = "" @@ -310,7 +312,8 @@ class ImportScripts::Mbox < ImportScripts::Base message, category FROM emails - WHERE reply_to IS NULL") + WHERE reply_to IS NULL + ORDER BY DATE(email_date)") topic_count = all_topics.size @@ -376,7 +379,9 @@ class ImportScripts::Mbox < ImportScripts::Base message, reply_to FROM emails - WHERE reply_to IS NOT NULL") + WHERE reply_to IS NOT NULL + ORDER BY DATE(email_date) + ") post_count = replies.size