diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-02-08 21:52:23 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-02-08 21:52:23 +0100 |
commit | e3514560569038f485d58c712f167790c346c536 (patch) | |
tree | 0129defda4677cc69dd85680ae710181632d436a /src/main/java/de | |
parent | d515b99796841f2209cc42336d9980ca03ee2e7e (diff) |
add index to message.conversationUuid
Diffstat (limited to 'src/main/java/de')
-rw-r--r-- | src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java b/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java index 50519a2a7..ef961f6a3 100644 --- a/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java +++ b/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java @@ -55,7 +55,7 @@ public class DatabaseBackend extends SQLiteOpenHelper { private static DatabaseBackend instance = null; public static final String DATABASE_NAME = "history"; - public static final int DATABASE_VERSION = 34; + public static final int DATABASE_VERSION = 35; private static String CREATE_CONTATCS_STATEMENT = "create table " + Contact.TABLENAME + "(" + Contact.ACCOUNT + " TEXT, " @@ -145,6 +145,7 @@ public class DatabaseBackend extends SQLiteOpenHelper { private static String START_TIMES_TABLE = "start_times"; private static String CREATE_START_TIMES_TABLE = "create table " + START_TIMES_TABLE + " (timestamp NUMBER);"; private static String CREATE_MESSAGE_TIME_INDEX = "create INDEX message_time_index ON " + Message.TABLENAME + "(" + Message.TIME_SENT + ")"; + private static String CREATE_MESSAGE_CONVERSATION_INDEX = "create INDEX message_conversation_index ON " + Message.TABLENAME + "(" + Message.CONVERSATION + ")"; private DatabaseBackend(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); @@ -195,6 +196,7 @@ public class DatabaseBackend extends SQLiteOpenHelper { + ") ON DELETE CASCADE);"); db.execSQL(CREATE_MESSAGE_TIME_INDEX); + db.execSQL(CREATE_MESSAGE_CONVERSATION_INDEX); db.execSQL(CREATE_CONTATCS_STATEMENT); db.execSQL(CREATE_DISCOVERY_RESULTS_STATEMENT); db.execSQL(CREATE_SESSIONS_STATEMENT); @@ -393,6 +395,9 @@ public class DatabaseBackend extends SQLiteOpenHelper { db.execSQL(CREATE_MESSAGE_TIME_INDEX); // do nothing else at this point because we have seperated videos, images, audios and other files in different directories } + if (oldVersion < 35 && newVersion >= 35) { + db.execSQL(CREATE_MESSAGE_CONVERSATION_INDEX); + } } private static ContentValues createFingerprintStatusContentValues(FingerprintStatus.Trust trust, boolean active) { |