create a db table for attachments
This commit is contained in:
parent
4cad413478
commit
0f33d3677b
4 changed files with 47 additions and 5 deletions
|
|
@ -1,7 +1,20 @@
|
|||
package com.simplemobiletools.smsmessenger.models
|
||||
|
||||
import android.net.Uri
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Index
|
||||
import androidx.room.PrimaryKey
|
||||
|
||||
@Entity(tableName = "attachments", indices = [(Index(value = ["message_id"], unique = true))])
|
||||
data class Attachment(
|
||||
@PrimaryKey(autoGenerate = true) var id: Long?,
|
||||
@ColumnInfo(name = "message_id") var messageId: Long,
|
||||
@ColumnInfo(name = "uri_string") var uriString: String,
|
||||
@ColumnInfo(name = "mimetype") var mimetype: String,
|
||||
@ColumnInfo(name = "width") var width: Int,
|
||||
@ColumnInfo(name = "height") var height: Int,
|
||||
@ColumnInfo(name = "filename") var filename: String) {
|
||||
|
||||
data class Attachment(var uriString: String, var mimetype: String, var width: Int, var height: Int, var filename: String) {
|
||||
fun getUri() = Uri.parse(uriString)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue