removing the id field at conversations, use thread_id
This commit is contained in:
parent
1c6d19c986
commit
d1616d4997
6 changed files with 30 additions and 21 deletions
|
|
@ -7,8 +7,7 @@ import androidx.room.PrimaryKey
|
|||
|
||||
@Entity(tableName = "conversations", indices = [(Index(value = ["thread_id"], unique = true))])
|
||||
data class Conversation(
|
||||
@PrimaryKey(autoGenerate = true) var id: Long?,
|
||||
@ColumnInfo(name = "thread_id") var threadId: Long,
|
||||
@PrimaryKey @ColumnInfo(name = "thread_id") var threadId: Long,
|
||||
@ColumnInfo(name = "snippet") var snippet: String,
|
||||
@ColumnInfo(name = "date") var date: Int,
|
||||
@ColumnInfo(name = "read") var read: Boolean,
|
||||
|
|
@ -16,8 +15,4 @@ data class Conversation(
|
|||
@ColumnInfo(name = "photo_uri") var photoUri: String,
|
||||
@ColumnInfo(name = "is_group_conversation") var isGroupConversation: Boolean,
|
||||
@ColumnInfo(name = "phone_number") var phoneNumber: String
|
||||
) {
|
||||
fun getStringToCompare(): String {
|
||||
return copy(id = 0).toString()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue