store the file name in the date takens and favorites tables too
This commit is contained in:
parent
402fccbc21
commit
8035d90e36
3 changed files with 4 additions and 2 deletions
|
@ -60,10 +60,10 @@ abstract class GalleryDatabase : RoomDatabase() {
|
||||||
|
|
||||||
private val MIGRATION_6_7 = object : Migration(6, 7) {
|
private val MIGRATION_6_7 = object : Migration(6, 7) {
|
||||||
override fun migrate(database: SupportSQLiteDatabase) {
|
override fun migrate(database: SupportSQLiteDatabase) {
|
||||||
database.execSQL("CREATE TABLE IF NOT EXISTS `date_takens` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `full_path` TEXT NOT NULL, `parent_path` TEXT NOT NULL, `last_fixed` INTEGER NOT NULL)")
|
database.execSQL("CREATE TABLE IF NOT EXISTS `date_takens` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `full_path` TEXT NOT NULL, `file_name` TEXT NOT NULL, `parent_path` TEXT NOT NULL, `last_fixed` INTEGER NOT NULL)")
|
||||||
database.execSQL("CREATE UNIQUE INDEX `index_date_takens_full_path` ON `date_takens` (`full_path`)")
|
database.execSQL("CREATE UNIQUE INDEX `index_date_takens_full_path` ON `date_takens` (`full_path`)")
|
||||||
|
|
||||||
database.execSQL("CREATE TABLE IF NOT EXISTS `favorites` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `full_path` TEXT NOT NULL, `parent_path` TEXT NOT NULL)")
|
database.execSQL("CREATE TABLE IF NOT EXISTS `favorites` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `full_path` TEXT NOT NULL, `file_name` TEXT NOT NULL, `parent_path` TEXT NOT NULL)")
|
||||||
database.execSQL("CREATE UNIQUE INDEX `index_favorites_full_path` ON `favorites` (`full_path`)")
|
database.execSQL("CREATE UNIQUE INDEX `index_favorites_full_path` ON `favorites` (`full_path`)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,5 +11,6 @@ import androidx.room.PrimaryKey
|
||||||
data class DateTaken(
|
data class DateTaken(
|
||||||
@PrimaryKey(autoGenerate = true) var id: Int?,
|
@PrimaryKey(autoGenerate = true) var id: Int?,
|
||||||
@ColumnInfo(name = "full_path") var fullPath: String,
|
@ColumnInfo(name = "full_path") var fullPath: String,
|
||||||
|
@ColumnInfo(name = "file_name") var fileName: String,
|
||||||
@ColumnInfo(name = "parent_path") var parentPath: String,
|
@ColumnInfo(name = "parent_path") var parentPath: String,
|
||||||
@ColumnInfo(name = "last_fixed") var lastFixed: Int)
|
@ColumnInfo(name = "last_fixed") var lastFixed: Int)
|
||||||
|
|
|
@ -9,4 +9,5 @@ import androidx.room.PrimaryKey
|
||||||
data class Favorite(
|
data class Favorite(
|
||||||
@PrimaryKey(autoGenerate = true) var id: Int?,
|
@PrimaryKey(autoGenerate = true) var id: Int?,
|
||||||
@ColumnInfo(name = "full_path") var fullPath: String,
|
@ColumnInfo(name = "full_path") var fullPath: String,
|
||||||
|
@ColumnInfo(name = "file_name") var fileName: String,
|
||||||
@ColumnInfo(name = "parent_path") var parentPath: String)
|
@ColumnInfo(name = "parent_path") var parentPath: String)
|
||||||
|
|
Loading…
Reference in a new issue