room: add indices
parent
6dfe308268
commit
3fb209a994
|
@ -9,7 +9,7 @@ import gallery.memories.R
|
|||
import gallery.memories.mapper.Photo
|
||||
|
||||
|
||||
@Database(entities = [Photo::class], version = 8)
|
||||
@Database(entities = [Photo::class], version = 9)
|
||||
abstract class AppDatabase : RoomDatabase() {
|
||||
abstract fun photoDao(): PhotoDao
|
||||
|
||||
|
|
|
@ -2,9 +2,19 @@ package gallery.memories.mapper
|
|||
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Index
|
||||
import androidx.room.PrimaryKey
|
||||
|
||||
@Entity(tableName="photos")
|
||||
@Entity(
|
||||
tableName = "photos", indices = [
|
||||
Index(value = ["local_id"]),
|
||||
Index(value = ["auid"]),
|
||||
Index(value = ["dayid"]),
|
||||
Index(value = ["flag"]),
|
||||
Index(value = ["bucket_id"]),
|
||||
Index(value = ["bucket_id", "dayid"])
|
||||
]
|
||||
)
|
||||
data class Photo(
|
||||
@PrimaryKey(autoGenerate = true) val id: Int? = null,
|
||||
@ColumnInfo(name = "local_id") val localId: Long,
|
||||
|
|
Loading…
Reference in New Issue