Index fields that are used when querying messages and conversations

This commit is contained in:
Moez Bhatti
2018-03-12 14:35:58 -07:00
parent f70cd965a7
commit 167c75cc83
2 changed files with 5 additions and 3 deletions
@@ -20,14 +20,15 @@ package data.model
import io.realm.RealmList
import io.realm.RealmObject
import io.realm.annotations.Index
import io.realm.annotations.PrimaryKey
open class Conversation : RealmObject() {
@PrimaryKey var id: Long = 0
var recipients: RealmList<Recipient> = RealmList()
var archived: Boolean = false
var blocked: Boolean = false
@Index var archived: Boolean = false
@Index var blocked: Boolean = false
var draft: String = ""
fun getTitle(): String {
+2 -1
View File
@@ -23,6 +23,7 @@ import android.net.Uri
import android.provider.Telephony.*
import io.realm.RealmList
import io.realm.RealmObject
import io.realm.annotations.Index
import io.realm.annotations.PrimaryKey
open class Message : RealmObject() {
@@ -36,7 +37,7 @@ open class Message : RealmObject() {
// since it's our primary key for the single message object, so we'll store the original id in
// case we need to access the original message item in the content provider
var contentId: Long = 0
var threadId: Long = 0
@Index var threadId: Long = 0
var address: String = ""
var boxId: Int = 0
var type: String = ""