[geary/wip/time_t-724335: 2/2] Repopulate internaldate_time_t with correct time_t



commit a854caf62d8b2f38d19f26b194ad32e315132bbf
Author: Charles Lindsay <chaz yorba org>
Date:   Fri Feb 14 15:25:28 2014 -0800

    Repopulate internaldate_time_t with correct time_t

 sql/version-018.sql                      |    6 ++++++
 src/engine/imap-db/imap-db-database.vala |    6 +++++-
 2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/sql/version-018.sql b/sql/version-018.sql
new file mode 100644
index 0000000..eda5126
--- /dev/null
+++ b/sql/version-018.sql
@@ -0,0 +1,6 @@
+--
+-- Nuke the internaldate_time_t column, because it had the wrong values.  It'll
+-- be repopulated in code, in imap-db-database.vala.
+--
+
+UPDATE MessageTable SET internaldate_time_t = NULL;
diff --git a/src/engine/imap-db/imap-db-database.vala b/src/engine/imap-db/imap-db-database.vala
index a4a8a8a..f9ce635 100644
--- a/src/engine/imap-db/imap-db-database.vala
+++ b/src/engine/imap-db/imap-db-database.vala
@@ -93,6 +93,10 @@ private class Geary.ImapDB.Database : Geary.Db.VersionedDatabase {
             case 15:
                 post_upgrade_fix_localized_internaldates();
             break;
+            
+            case 18:
+                post_upgrade_populate_internal_date_time_t();
+            break;
         }
     }
     
@@ -202,7 +206,7 @@ private class Geary.ImapDB.Database : Geary.Db.VersionedDatabase {
         return "english";
     }
     
-    // Version 12.
+    // Versions 12 and 18.
     private void post_upgrade_populate_internal_date_time_t() {
         try {
             exec_transaction(Db.TransactionType.RW, (cx) => {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]