creating a room DB for storing conversations
This commit is contained in:
parent
4e89e8b7ac
commit
f638fa06f2
7 changed files with 72 additions and 11 deletions
|
|
@ -1,5 +1,19 @@
|
|||
package com.simplemobiletools.smsmessenger.models
|
||||
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Index
|
||||
import androidx.room.PrimaryKey
|
||||
|
||||
@Entity(tableName = "conversations", indices = [(Index(value = ["id"], unique = true))])
|
||||
data class Conversation(
|
||||
val id: Int, val snippet: String, val date: Int, val read: Boolean, var title: String, var photoUri: String,
|
||||
val isGroupConversation: Boolean, val phoneNumber: String)
|
||||
@PrimaryKey(autoGenerate = true) var id: Long?,
|
||||
@ColumnInfo(name = "system_id") var system_id: Int,
|
||||
@ColumnInfo(name = "snippet") var snippet: String,
|
||||
@ColumnInfo(name = "date") var date: Int,
|
||||
@ColumnInfo(name = "read") var read: Boolean,
|
||||
@ColumnInfo(name = "title") var title: String,
|
||||
@ColumnInfo(name = "photo_uri") var photoUri: String,
|
||||
@ColumnInfo(name = "is_group_conversation") var isGroupConversation: Boolean,
|
||||
@ColumnInfo(name = "phone_number") var phoneNumber: String
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue