From b4a81bf9374a4febaa36c2c89445040844e85c4a Mon Sep 17 00:00:00 2001 From: Mikunj Date: Mon, 2 Dec 2019 13:29:12 +1100 Subject: [PATCH] Update create table command because it might exist already. --- src/org/thoughtcrime/securesms/loki/LokiMessageDatabase.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/loki/LokiMessageDatabase.kt b/src/org/thoughtcrime/securesms/loki/LokiMessageDatabase.kt index 817b76f5dd..f25f39e955 100644 --- a/src/org/thoughtcrime/securesms/loki/LokiMessageDatabase.kt +++ b/src/org/thoughtcrime/securesms/loki/LokiMessageDatabase.kt @@ -19,7 +19,7 @@ class LokiMessageDatabase(context: Context, helper: SQLCipherOpenHelper) : Datab private val friendRequestStatus = "friend_request_status" private val threadID = "thread_id" @JvmStatic val createMessageFriendRequestTableCommand = "CREATE TABLE $messageFriendRequestTableName ($messageID INTEGER PRIMARY KEY, $serverID INTEGER DEFAULT 0, $friendRequestStatus INTEGER DEFAULT 0);" - @JvmStatic val createMessageToThreadMappingTableCommand = "CREATE TABLE $messageThreadMappingTableName ($messageID INTEGER PRIMARY KEY, $threadID INTEGER);" + @JvmStatic val createMessageToThreadMappingTableCommand = "CREATE TABLE IF NOT EXISTS $messageThreadMappingTableName ($messageID INTEGER PRIMARY KEY, $threadID INTEGER);" } override fun getQuoteServerID(quoteID: Long, quoteeHexEncodedPublicKey: String): Long? {