From 118560cf0d6d24b4ffe5215c02277d5455dffd81 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Sun, 6 Jan 2013 18:47:20 -0800 Subject: [PATCH] Fix for DB creation and migration with new date schema changes. --- src/org/thoughtcrime/securesms/database/MmsDatabase.java | 2 +- src/org/thoughtcrime/securesms/database/SmsMigrator.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/database/MmsDatabase.java b/src/org/thoughtcrime/securesms/database/MmsDatabase.java index bf508f5309..a4f1ecf840 100644 --- a/src/org/thoughtcrime/securesms/database/MmsDatabase.java +++ b/src/org/thoughtcrime/securesms/database/MmsDatabase.java @@ -79,7 +79,7 @@ public class MmsDatabase extends Database { private static final String DELIVERY_REPORT = "d_rpt"; public static final String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " (" + ID + " INTEGER PRIMARY KEY, " + - THREAD_ID + " INTEGER, " + DATE_SENT + " INTEGER, " + DATE_RECEIVED + "INTEGER, " + MESSAGE_BOX + " INTEGER, " + + THREAD_ID + " INTEGER, " + DATE_SENT + " INTEGER, " + DATE_RECEIVED + " INTEGER, " + MESSAGE_BOX + " INTEGER, " + READ + " INTEGER DEFAULT 0, " + MESSAGE_ID + " TEXT, " + SUBJECT + " TEXT, " + SUBJECT_CHARSET + " INTEGER, " + CONTENT_TYPE + " TEXT, " + CONTENT_LOCATION + " TEXT, " + EXPIRY + " INTEGER, " + MESSAGE_CLASS + " TEXT, " + MESSAGE_TYPE + " INTEGER, " + diff --git a/src/org/thoughtcrime/securesms/database/SmsMigrator.java b/src/org/thoughtcrime/securesms/database/SmsMigrator.java index acda6907ca..92152b9531 100644 --- a/src/org/thoughtcrime/securesms/database/SmsMigrator.java +++ b/src/org/thoughtcrime/securesms/database/SmsMigrator.java @@ -77,7 +77,7 @@ public class SmsMigrator { { addStringToStatement(statement, cursor, 1, SmsDatabase.ADDRESS); addIntToStatement(statement, cursor, 2, SmsDatabase.PERSON); - addIntToStatement(statement, cursor, 3, SmsDatabase.DATE_SENT); + addIntToStatement(statement, cursor, 3, SmsDatabase.DATE_RECEIVED); addIntToStatement(statement, cursor, 4, SmsDatabase.DATE_RECEIVED); addIntToStatement(statement, cursor, 5, SmsDatabase.PROTOCOL); addIntToStatement(statement, cursor, 6, SmsDatabase.READ);