mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
Merge pull request #4422 from steinwaywhw/patch-2
Fix SQLite datetime issues
This commit is contained in:
commit
6036770c0d
1 changed files with 2 additions and 1 deletions
|
@ -100,7 +100,7 @@ class ImportScripts::Mbox < ImportScripts::Base
|
||||||
db = open_db
|
db = open_db
|
||||||
db.execute "UPDATE emails SET reply_to = null WHERE reply_to = ''"
|
db.execute "UPDATE emails SET reply_to = null WHERE reply_to = ''"
|
||||||
|
|
||||||
rows = db.execute "SELECT msg_id, title, reply_to FROM emails ORDER BY email_date ASC"
|
rows = db.execute "SELECT msg_id, title, reply_to FROM emails ORDER BY datetime(email_date) ASC"
|
||||||
|
|
||||||
msg_ids = {}
|
msg_ids = {}
|
||||||
titles = {}
|
titles = {}
|
||||||
|
@ -199,6 +199,7 @@ class ImportScripts::Mbox < ImportScripts::Base
|
||||||
title = clean_title(mail['Subject'].to_s)
|
title = clean_title(mail['Subject'].to_s)
|
||||||
reply_to = mail['In-Reply-To'].to_s
|
reply_to = mail['In-Reply-To'].to_s
|
||||||
email_date = mail['date'].to_s
|
email_date = mail['date'].to_s
|
||||||
|
email_date = DateTime.parse(email_date).to_s unless email_date.blank?
|
||||||
|
|
||||||
db.execute "INSERT OR IGNORE INTO emails (msg_id,
|
db.execute "INSERT OR IGNORE INTO emails (msg_id,
|
||||||
from_email,
|
from_email,
|
||||||
|
|
Loading…
Reference in a new issue